# HG changeset patch # User Sverre Rabbelier # Date 1239542043 0 # Node ID 83d96aadd228af770b289f6944e3d3a5e22c51fd # Parent cec46675f866daf27d53ffecff6d8b6a45f40bdf Do not rely on a backup_admin being set Patch by: Sverre Rabbelier diff -r cec46675f866 -r 83d96aadd228 app/soc/logic/helper/notifications.py --- a/app/soc/logic/helper/notifications.py Sun Apr 12 12:31:55 2009 +0000 +++ b/app/soc/logic/helper/notifications.py Sun Apr 12 13:14:03 2009 +0000 @@ -125,6 +125,9 @@ template = DEF_NEW_GROUP_TEMPLATE for to in [entity.applicant, entity.backup_admin]: + if not to: + continue + sendNotification(to, None, message_properties, subject, template) diff -r cec46675f866 -r 83d96aadd228 app/soc/views/helper/access.py --- a/app/soc/views/helper/access.py Sun Apr 12 12:31:55 2009 +0000 +++ b/app/soc/views/helper/access.py Sun Apr 12 13:14:03 2009 +0000 @@ -1115,7 +1115,8 @@ application = app_logic.getFromKeyFieldsOr404(django_args) applicant = application.applicant.key() - backup_admin = application.backup_admin.key() + backup_admin = application.backup_admin + backup_admin = backup_admin.key() if backup_admin else None user = self.user.key() # check if the application is accepted and the applicant is the current user diff -r cec46675f866 -r 83d96aadd228 app/soc/views/models/org_app.py --- a/app/soc/views/models/org_app.py Sun Apr 12 12:31:55 2009 +0000 +++ b/app/soc/views/models/org_app.py Sun Apr 12 13:14:03 2009 +0000 @@ -243,6 +243,9 @@ context['subject'] = 'Thank you for your application' for to in [admin_entity, backup_entity]: + if not to: + continue + email = accounts.denormalizeAccount(to.account).email() context['to'] = email context['to_name'] = to.name