app/soc/views/helper/access.py
changeset 1200 e68fd70ba076
parent 1198 3318f8d00691
child 1201 0a4c1af700a0
equal deleted inserted replaced
1199:4e69a5f30a9a 1200:e68fd70ba076
   656       self.deny(django_args)
   656       self.deny(django_args)
   657 
   657 
   658     new_args = {'scope_path': program.scope_path }
   658     new_args = {'scope_path': program.scope_path }
   659     self.checkHasRole(new_args, host_logic)
   659     self.checkHasRole(new_args, host_logic)
   660 
   660 
       
   661 
       
   662   @allowDeveloper
       
   663   def checkCanEditGroupApp(self, django_args, group_app_logic):
       
   664     """Checks if the group_app in args is valid to be edited.
       
   665 
       
   666     Args:
       
   667       group_app_logic: A logic instance for the Group Application
       
   668     """
       
   669 
       
   670     self.checkIsUser(django_args)
       
   671 
       
   672     fields = {
       
   673         'link_id': django_args['link_id'],
       
   674         'applicant': self.user,
       
   675         'status' : ['needs review', 'rejected']
       
   676         }
       
   677 
       
   678     if 'scope_path' in django_args:
       
   679       fields['scope_path'] = django_args['scope_path']
       
   680 
       
   681     entity = group_app_logic.getForFields(fields)
       
   682 
       
   683     if entity:
       
   684       return
       
   685 
       
   686     raise out_of_band.AccessViolation(message_fmt=DEF_NOT_YOUR_ENTITY_MSG)
       
   687 
       
   688 
   661   @allowDeveloper
   689   @allowDeveloper
   662   def checkIsApplicationAccepted(self, django_args, app_logic):
   690   def checkIsApplicationAccepted(self, django_args, app_logic):
   663     """Returns an alternate HTTP response if Google Account has no Club App
   691     """Returns an alternate HTTP response if Google Account has no Club App
   664        entity for the specified Club.
   692        entity for the specified Club.
   665 
   693 
   699 
   727 
   700     fields = {
   728     fields = {
   701         'link_id': django_args['link_id'],
   729         'link_id': django_args['link_id'],
   702         field_name: self.user if user else self.user.key().name()
   730         field_name: self.user if user else self.user.key().name()
   703         }
   731         }
       
   732 
       
   733     if 'scope_path' in django_args:
       
   734       fields['scope_path'] = django_args['scope_path']
   704 
   735 
   705     entity = logic.getForFields(fields)
   736     entity = logic.getForFields(fields)
   706 
   737 
   707     if entity:
   738     if entity:
   708       return
   739       return