app/soc/views/helper/access.py
changeset 2169 79bb965e723a
parent 2160 3f9dd37d98a8
child 2171 83d96aadd228
equal deleted inserted replaced
2168:ef7222d4847f 2169:79bb965e723a
  1112     """
  1112     """
  1113 
  1113 
  1114     self.checkIsUser(django_args)
  1114     self.checkIsUser(django_args)
  1115 
  1115 
  1116     application = app_logic.getFromKeyFieldsOr404(django_args)
  1116     application = app_logic.getFromKeyFieldsOr404(django_args)
       
  1117     applicant = application.applicant.key()
       
  1118     backup_admin = application.backup_admin.key()
       
  1119     user = self.user.key()
  1117 
  1120 
  1118     # check if the application is accepted and the applicant is the current user
  1121     # check if the application is accepted and the applicant is the current user
  1119     if (application.applicant.key() == self.user.key()) and (
  1122     if application.status == 'accepted' and (applicant == user or
  1120         application.status == 'accepted'):
  1123                                              backup_admin == user):
  1121       return
  1124       return
  1122 
  1125 
  1123     raise out_of_band.AccessViolation(message_fmt=DEF_NO_APPLICATION_MSG)
  1126     raise out_of_band.AccessViolation(message_fmt=DEF_NO_APPLICATION_MSG)
  1124 
  1127 
  1125   def checkIsNotParticipatingInProgramInScope(self, django_args):
  1128   def checkIsNotParticipatingInProgramInScope(self, django_args):