Revision 466cc12c
b/snf-astakos-app/astakos/im/functions.py | ||
---|---|---|
69 | 69 |
AstakosUser, ProjectMembership, ProjectApplication, Project, |
70 | 70 |
PendingMembershipError, get_resource_names, new_chain) |
71 | 71 |
from astakos.im.project_notif import ( |
72 |
membership_change_notify, |
|
72 |
membership_change_notify, membership_enroll_notify,
|
|
73 | 73 |
application_submit_notify, application_approve_notify, |
74 | 74 |
application_deny_notify, |
75 | 75 |
project_termination_notify, project_suspension_notify) |
... | ... | |
585 | 585 |
raise PermissionDenied(m) |
586 | 586 |
|
587 | 587 |
membership.accept() |
588 |
membership_enroll_notify(project, membership.person) |
|
588 | 589 |
|
589 |
# TODO send proper notification |
|
590 | 590 |
return membership |
591 | 591 |
|
592 | 592 |
def leave_project_checks(project): |
b/snf-astakos-app/astakos/im/project_notif.py | ||
---|---|---|
10 | 10 |
'template': 'im/projects/project_membership_change_notification.txt', |
11 | 11 |
} |
12 | 12 |
|
13 |
MEM_ENROLL_NOTIF = { |
|
14 |
'subject' : _(settings.PROJECT_MEMBERSHIP_ENROLL_SUBJECT), |
|
15 |
'template': 'im/projects/project_membership_enroll_notification.txt', |
|
16 |
} |
|
17 |
|
|
13 | 18 |
SENDER = settings.SERVER_EMAIL |
14 | 19 |
ADMINS = settings.ADMINS |
15 | 20 |
|
... | ... | |
25 | 30 |
except NotificationError, e: |
26 | 31 |
logger.error(e.message) |
27 | 32 |
|
33 |
def membership_enroll_notify(project, user): |
|
34 |
try: |
|
35 |
notification = build_notification( |
|
36 |
SENDER, |
|
37 |
[user.email], |
|
38 |
MEM_ENROLL_NOTIF['subject'] % project.__dict__, |
|
39 |
template= MEM_ENROLL_NOTIF['template'], |
|
40 |
dictionary={'object':project}) |
|
41 |
notification.send() |
|
42 |
except NotificationError, e: |
|
43 |
logger.error(e.message) |
|
44 |
|
|
28 | 45 |
def application_submit_notify(application): |
29 | 46 |
try: |
30 | 47 |
notification = build_notification( |
b/snf-astakos-app/astakos/im/settings.py | ||
---|---|---|
161 | 161 |
PROJECT_MEMBERSHIP_CHANGE_SUBJECT = getattr( |
162 | 162 |
settings, 'ASTAKOS_PROJECT_MEMBERSHIP_CHANGE_SUBJECT', |
163 | 163 |
'%s alpha2 testing project membership changed (%%(name)s)' % SITENAME) |
164 |
PROJECT_MEMBERSHIP_ENROLL_SUBJECT = getattr( |
|
165 |
settings, 'ASTAKOS_PROJECT_MEMBERSHIP_ENROLL_SUBJECT', |
|
166 |
'%s alpha2 testing project enrollment (%%(name)s)' % SITENAME) |
|
164 | 167 |
|
165 | 168 |
# Set the quota holder component URI |
166 | 169 |
QUOTAHOLDER_URL = getattr(settings, 'ASTAKOS_QUOTAHOLDER_URL', '') |
b/snf-astakos-app/astakos/im/templates/im/projects/project_membership_enroll_notification.txt | ||
---|---|---|
1 |
--- A translation in English follows --- |
|
2 |
|
|
3 |
Έχετε εγγραφεί στο project {{object.name}}. |
|
4 |
-- |
|
5 |
|
|
6 |
You have been enrolled in project {{object.name}}. |
Also available in: Unified diff