Revision 9202a57d

b/snf-astakos-app/astakos/im/project_notif.py
90 90

  
91 91

  
92 92
def membership_request_notify(project, requested_user, action):
93
    owner = project.owner
94
    if owner is None:
95
        return
93 96
    subject, template = MEMBERSHIP_REQUEST_DATA[action](project)
94 97
    try:
95 98
        build_notification(
96
            SENDER, [project.owner.email], subject,
99
            SENDER, [owner.email], subject,
97 100
            template=template,
98 101
            dictionary={'object': project, 'user': requested_user.email}
99 102
        ).send()
......
107 110
        _(messages.PROJECT_CREATION_SUBJECT) % a.__dict__,
108 111
        "im/projects/project_creation_notification.txt"),
109 112
    "deny": lambda a: (
110
        [a.owner.email],
113
        [a.applicant.email],
111 114
        _(messages.PROJECT_DENIED_SUBJECT) % a.__dict__,
112 115
        "im/projects/project_denial_notification.txt"),
113 116
    "approve": lambda a: (
114
        [a.owner.email],
117
        [a.applicant.email],
115 118
        _(messages.PROJECT_APPROVED_SUBJECT) % a.__dict__,
116 119
        "im/projects/project_approval_notification.txt"),
117 120
}
......
146 149

  
147 150

  
148 151
def project_notify(project, action):
152
    owner = project.owner
153
    if owner is None:
154
        return
149 155
    subject, template = PROJECT_DATA[action](project)
150 156
    try:
151 157
        build_notification(
152
            SENDER, [project.owner.email], subject,
158
            SENDER, [owner.email], subject,
153 159
            template=template,
154 160
            dictionary={'object': project}
155 161
        ).send()

Also available in: Unified diff