Revision cfb7dd4f snf-astakos-app/astakos/im/project_notif.py

b/snf-astakos-app/astakos/im/project_notif.py
2 2
from django.utils.translation import ugettext as _
3 3
from astakos.im import settings
4 4
from astakos.im.notifications import build_notification, NotificationError
5
from astakos.im import messages
5 6

  
6 7
logger = logging.getLogger(__name__)
7 8

  
8 9
MEM_CHANGE_NOTIF = {
9
    'subject' : _(settings.PROJECT_MEMBERSHIP_CHANGE_SUBJECT),
10
    'subject' : _(messages.PROJECT_MEMBERSHIP_CHANGE_SUBJECT),
10 11
    'template': 'im/projects/project_membership_change_notification.txt',
11 12
    }
12 13

  
13 14
MEM_ENROLL_NOTIF = {
14
    'subject' : _(settings.PROJECT_MEMBERSHIP_ENROLL_SUBJECT),
15
    'subject' : _(messages.PROJECT_MEMBERSHIP_ENROLL_SUBJECT),
15 16
    'template': 'im/projects/project_membership_enroll_notification.txt',
16 17
    }
17 18

  
......
47 48
        notification = build_notification(
48 49
            SENDER,
49 50
            [project.application.owner.email],
50
            _(settings.PROJECT_MEMBERSHIP_REQUEST_SUBJECT) % project.__dict__,
51
            _(messages.PROJECT_MEMBERSHIP_REQUEST_SUBJECT) % project.__dict__,
51 52
            template= 'im/projects/project_membership_request_notification.txt',
52 53
            dictionary={'object':project, 'user':requested_user.email})
53 54
        notification.send()
......
59 60
        notification = build_notification(
60 61
            SENDER,
61 62
            [project.application.owner.email],
62
            _(settings.PROJECT_MEMBERSHIP_LEAVE_REQUEST_SUBJECT) % project.__dict__,
63
            _(messages.PROJECT_MEMBERSHIP_LEAVE_REQUEST_SUBJECT) %
64
            project.__dict__,
63 65
            template= 'im/projects/project_membership_leave_request_notification.txt',
64 66
            dictionary={'object':project, 'user':requested_user.email})
65 67
        notification.send()
......
70 72
    try:
71 73
        notification = build_notification(
72 74
            SENDER, NOTIFY_RECIPIENTS,
73
            _(settings.PROJECT_CREATION_SUBJECT) % application.__dict__,
75
            _(messages.PROJECT_CREATION_SUBJECT) % application.__dict__,
74 76
            template='im/projects/project_creation_notification.txt',
75 77
            dictionary={'object':application})
76 78
        notification.send()
......
82 84
        notification = build_notification(
83 85
            SENDER,
84 86
            [application.owner.email],
85
            _(settings.PROJECT_DENIED_SUBJECT) % application.__dict__,
87
            _(messages.PROJECT_DENIED_SUBJECT) % application.__dict__,
86 88
            template='im/projects/project_denial_notification.txt',
87 89
            dictionary={'object':application})
88 90
        notification.send()
......
94 96
        notification = build_notification(
95 97
            SENDER,
96 98
            [application.owner.email],
97
            _(settings.PROJECT_APPROVED_SUBJECT) % application.__dict__,
99
            _(messages.PROJECT_APPROVED_SUBJECT) % application.__dict__,
98 100
            template='im/projects/project_approval_notification.txt',
99 101
            dictionary={'object':application})
100 102
        notification.send()
......
106 108
        notification = build_notification(
107 109
            SENDER,
108 110
            [project.application.owner.email],
109
            _(settings.PROJECT_TERMINATION_SUBJECT) % project.__dict__,
111
            _(messages.PROJECT_TERMINATION_SUBJECT) % project.__dict__,
110 112
            template='im/projects/project_termination_notification.txt',
111 113
            dictionary={'object':project}
112 114
        ).send()
......
118 120
        notification = build_notification(
119 121
            SENDER,
120 122
            [project.application.owner.email],
121
            _(settings.PROJECT_SUSPENSION_SUBJECT) % project.__dict__,
123
            _(messages.PROJECT_SUSPENSION_SUBJECT) % project.__dict__,
122 124
            template='im/projects/project_suspension_notification.txt',
123 125
            dictionary={'object':project}
124 126
        ).send()

Also available in: Unified diff