Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
itminedu
synnefo
Commits
c78a9076
Commit
c78a9076
authored
Jul 16, 2013
by
Giorgos Korfiatis
Browse files
astakos: Fix arg passing in messages
parent
5145b22d
Changes
5
Show whitespace changes
Inline
Side-by-side
snf-astakos-app/astakos/im/functions.py
View file @
c78a9076
...
@@ -369,7 +369,7 @@ def checkAllowed(entity, request_user, admin_only=False):
...
@@ -369,7 +369,7 @@ def checkAllowed(entity, request_user, admin_only=False):
def
checkAlive
(
project
):
def
checkAlive
(
project
):
if
not
project
.
is_alive
:
if
not
project
.
is_alive
:
m
=
_
(
astakos_messages
.
NOT_ALIVE_PROJECT
)
%
project
.
__dict__
m
=
_
(
astakos_messages
.
NOT_ALIVE_PROJECT
)
%
project
.
id
raise
PermissionDenied
(
m
)
raise
PermissionDenied
(
m
)
...
@@ -803,7 +803,7 @@ def resume(project_id, request_user=None):
...
@@ -803,7 +803,7 @@ def resume(project_id, request_user=None):
checkAllowed
(
project
,
request_user
,
admin_only
=
True
)
checkAllowed
(
project
,
request_user
,
admin_only
=
True
)
if
not
project
.
is_suspended
:
if
not
project
.
is_suspended
:
m
=
_
(
astakos_messages
.
NOT_SUSPENDED_PROJECT
)
%
project
.
__dict__
m
=
_
(
astakos_messages
.
NOT_SUSPENDED_PROJECT
)
%
project
.
id
raise
PermissionDenied
(
m
)
raise
PermissionDenied
(
m
)
project
.
resume
()
project
.
resume
()
...
...
snf-astakos-app/astakos/im/messages.py
View file @
c78a9076
...
@@ -161,9 +161,8 @@ INVALID_KEY_PARAMETER = 'Invalid key.'
...
@@ -161,9 +161,8 @@ INVALID_KEY_PARAMETER = 'Invalid key.'
DOMAIN_VALUE_ERR
=
'Enter a valid domain.'
DOMAIN_VALUE_ERR
=
'Enter a valid domain.'
QH_SYNC_ERROR
=
'Failed to get synchronized with quotaholder.'
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.'
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 %s is not alive.'
NOT_ALIVE_PROJECT
=
'Project %(id)s is not alive.'
NOT_SUSPENDED_PROJECT
=
'Project %s is not suspended.'
NOT_SUSPENDED_PROJECT
=
'Project %(id)s is not suspended.'
NOT_ALLOWED
=
'You do not have the permissions to perform this action.'
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_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.'
MEMBER_JOIN_POLICY_CLOSED
=
'The Project
\'
s member join policy is closed.'
...
...
snf-astakos-app/astakos/im/project_notif.py
View file @
c78a9076
...
@@ -104,11 +104,12 @@ def application_approve_notify(application):
...
@@ -104,11 +104,12 @@ def application_approve_notify(application):
logger
.
error
(
e
.
message
)
logger
.
error
(
e
.
message
)
def
project_termination_notify
(
project
):
def
project_termination_notify
(
project
):
app
=
project
.
application
try
:
try
:
notification
=
build_notification
(
notification
=
build_notification
(
SENDER
,
SENDER
,
[
project
.
application
.
owner
.
email
],
[
project
.
application
.
owner
.
email
],
_
(
messages
.
PROJECT_TERMINATION_SUBJECT
)
%
project
.
__dict__
,
_
(
messages
.
PROJECT_TERMINATION_SUBJECT
)
%
app
.
__dict__
,
template
=
'im/projects/project_termination_notification.txt'
,
template
=
'im/projects/project_termination_notification.txt'
,
dictionary
=
{
'object'
:
project
}
dictionary
=
{
'object'
:
project
}
).
send
()
).
send
()
...
...
snf-astakos-app/astakos/im/templates/im/projects/project_suspension_notification.txt
View file @
c78a9076
{% extends "im/email.txt" %}
{% extends "im/email.txt" %}
{% block content %}
{% block content %}
Your project
application request
({{object.name}}) has been suspended.
Your project ({{object.name}}) has been suspended.
{% endblock content %}
{% endblock content %}
snf-astakos-app/astakos/im/templates/im/projects/project_termination_notification.txt
View file @
c78a9076
{% extends "im/email.txt" %}
{% extends "im/email.txt" %}
{% block content %}
{% block content %}
Your project application
request ({{object
.name}}) has been terminated.
Your project
({{object.
application.name}}) has been terminated.
{% endblock content %}
{% endblock content %}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment