Allow the backup_admin to fill in the org application
authorSverre Rabbelier <srabbelier@gmail.com>
Sun, 12 Apr 2009 12:31:23 +0000
changeset 2169 79bb965e723a
parent 2168 ef7222d4847f
child 2170 cec46675f866
Allow the backup_admin to fill in the org application Patch by: Sverre Rabbelier
app/soc/views/helper/access.py
--- a/app/soc/views/helper/access.py	Sun Apr 12 09:06:45 2009 +0000
+++ b/app/soc/views/helper/access.py	Sun Apr 12 12:31:23 2009 +0000
@@ -1114,10 +1114,13 @@
     self.checkIsUser(django_args)
 
     application = app_logic.getFromKeyFieldsOr404(django_args)
+    applicant = application.applicant.key()
+    backup_admin = application.backup_admin.key()
+    user = self.user.key()
 
     # check if the application is accepted and the applicant is the current user
-    if (application.applicant.key() == self.user.key()) and (
-        application.status == 'accepted'):
+    if application.status == 'accepted' and (applicant == user or
+                                             backup_admin == user):
       return
 
     raise out_of_band.AccessViolation(message_fmt=DEF_NO_APPLICATION_MSG)