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
a7f83de7
Commit
a7f83de7
authored
Feb 04, 2013
by
Giorgos Korfiatis
Committed by
Georgios D. Tsoukalas
Feb 14, 2013
Browse files
Notify for project enrollment
parent
356c9835
Changes
4
Hide whitespace changes
Inline
Side-by-side
snf-astakos-app/astakos/im/functions.py
View file @
a7f83de7
...
...
@@ -69,7 +69,7 @@ from astakos.im.models import (
AstakosUser
,
ProjectMembership
,
ProjectApplication
,
Project
,
PendingMembershipError
,
get_resource_names
,
new_chain
)
from
astakos.im.project_notif
import
(
membership_change_notify
,
membership_change_notify
,
membership_enroll_notify
,
application_submit_notify
,
application_approve_notify
,
application_deny_notify
,
project_termination_notify
,
project_suspension_notify
)
...
...
@@ -585,8 +585,8 @@ def enroll_member(project_id, user, request_user=None):
raise
PermissionDenied
(
m
)
membership
.
accept
()
membership_enroll_notify
(
project
,
membership
.
person
)
# TODO send proper notification
return
membership
def
leave_project_checks
(
project
):
...
...
snf-astakos-app/astakos/im/project_notif.py
View file @
a7f83de7
...
...
@@ -10,6 +10,11 @@ MEM_CHANGE_NOTIF = {
'template'
:
'im/projects/project_membership_change_notification.txt'
,
}
MEM_ENROLL_NOTIF
=
{
'subject'
:
_
(
settings
.
PROJECT_MEMBERSHIP_ENROLL_SUBJECT
),
'template'
:
'im/projects/project_membership_enroll_notification.txt'
,
}
SENDER
=
settings
.
SERVER_EMAIL
ADMINS
=
settings
.
ADMINS
...
...
@@ -25,6 +30,18 @@ def membership_change_notify(project, user, action):
except
NotificationError
,
e
:
logger
.
error
(
e
.
message
)
def
membership_enroll_notify
(
project
,
user
):
try
:
notification
=
build_notification
(
SENDER
,
[
user
.
email
],
MEM_ENROLL_NOTIF
[
'subject'
]
%
project
.
__dict__
,
template
=
MEM_ENROLL_NOTIF
[
'template'
],
dictionary
=
{
'object'
:
project
})
notification
.
send
()
except
NotificationError
,
e
:
logger
.
error
(
e
.
message
)
def
application_submit_notify
(
application
):
try
:
notification
=
build_notification
(
...
...
snf-astakos-app/astakos/im/settings.py
View file @
a7f83de7
...
...
@@ -161,6 +161,9 @@ PROJECT_SUSPENSION_SUBJECT = getattr(
PROJECT_MEMBERSHIP_CHANGE_SUBJECT
=
getattr
(
settings
,
'ASTAKOS_PROJECT_MEMBERSHIP_CHANGE_SUBJECT'
,
'%s alpha2 testing project membership changed (%%(name)s)'
%
SITENAME
)
PROJECT_MEMBERSHIP_ENROLL_SUBJECT
=
getattr
(
settings
,
'ASTAKOS_PROJECT_MEMBERSHIP_ENROLL_SUBJECT'
,
'%s alpha2 testing project enrollment (%%(name)s)'
%
SITENAME
)
# Set the quota holder component URI
QUOTAHOLDER_URL
=
getattr
(
settings
,
'ASTAKOS_QUOTAHOLDER_URL'
,
''
)
...
...
snf-astakos-app/astakos/im/templates/im/projects/project_membership_enroll_notification.txt
0 → 100644
View file @
a7f83de7
--- A translation in English follows ---
Έχετε εγγραφεί στο project {{object.name}}.
--
You have been enrolled in project {{object.name}}.
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