Commit c78a9076 authored by Giorgos Korfiatis's avatar Giorgos Korfiatis
Browse files

astakos: Fix arg passing in messages

parent 5145b22d
......@@ -369,7 +369,7 @@ def checkAllowed(entity, request_user, admin_only=False):
def checkAlive(project):
if not project.is_alive:
m = _(astakos_messages.NOT_ALIVE_PROJECT) % project.__dict__
m = _(astakos_messages.NOT_ALIVE_PROJECT) % project.id
raise PermissionDenied(m)
......@@ -803,7 +803,7 @@ def resume(project_id, request_user=None):
checkAllowed(project, request_user, admin_only=True)
if not project.is_suspended:
m = _(astakos_messages.NOT_SUSPENDED_PROJECT) % project.__dict__
m = _(astakos_messages.NOT_SUSPENDED_PROJECT) % project.id
raise PermissionDenied(m)
project.resume()
......
......@@ -161,9 +161,8 @@ INVALID_KEY_PARAMETER = 'Invalid key.'
DOMAIN_VALUE_ERR = 'Enter a valid domain.'
QH_SYNC_ERROR = 'Failed to get synchronized with quotaholder.'
UNIQUE_PROJECT_NAME_CONSTRAIN_ERR = 'The project name (as specified in its application\'s definition) must be unique among all active projects.'
INVALID_PROJECT = 'Project %(id)s is invalid.'
NOT_ALIVE_PROJECT = 'Project %(id)s is not alive.'
NOT_SUSPENDED_PROJECT = 'Project %(id)s is not suspended.'
NOT_ALIVE_PROJECT = 'Project %s is not alive.'
NOT_SUSPENDED_PROJECT = 'Project %s is not suspended.'
NOT_ALLOWED = 'You do not have the permissions to perform this action.'
MEMBER_NUMBER_LIMIT_REACHED = 'You have reached the maximum number of members for this Project.'
MEMBER_JOIN_POLICY_CLOSED = 'The Project\'s member join policy is closed.'
......
......@@ -104,11 +104,12 @@ def application_approve_notify(application):
logger.error(e.message)
def project_termination_notify(project):
app = project.application
try:
notification = build_notification(
SENDER,
[project.application.owner.email],
_(messages.PROJECT_TERMINATION_SUBJECT) % project.__dict__,
_(messages.PROJECT_TERMINATION_SUBJECT) % app.__dict__,
template='im/projects/project_termination_notification.txt',
dictionary={'object':project}
).send()
......
{% extends "im/email.txt" %}
{% block content %}
Your project application request ({{object.name}}) has been suspended.
Your project ({{object.name}}) has been suspended.
{% endblock content %}
{% extends "im/email.txt" %}
{% block content %}
Your project application request ({{object.name}}) has been terminated.
{% endblock content %}
\ No newline at end of file
Your project ({{object.application.name}}) has been terminated.
{% endblock content %}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment