app/soc/views/models/group.py
changeset 1218 569a3fe9cb88
parent 1153 4804f7f5a7c0
child 1283 438dceed3132
equal deleted inserted replaced
1217:aeabe6bed55b 1218:569a3fe9cb88
   152       kwargs: the Key Fields for the specified entity
   152       kwargs: the Key Fields for the specified entity
   153     """
   153     """
   154 
   154 
   155     # find the application
   155     # find the application
   156     application_logic = params['application_logic']
   156     application_logic = params['application_logic']
   157     key_fields = application_logic.logic.getKeyFieldsFromFields(kwargs)
   157     application = application_logic.logic.getFromKeyFields(kwargs)
   158     application = application_logic.logic.getFromKeyFields(key_fields)
       
   159 
   158 
   160     # extract the application fields
   159     # extract the application fields
   161     field_names = application.properties().keys()
   160     field_names = application.properties().keys()
   162     fields = dict( [(i, getattr(application, i)) for i in field_names] )
   161     fields = dict( [(i, getattr(application, i)) for i in field_names] )
   163 
   162 
   192 
   191 
   193     # do post processing
   192     # do post processing
   194     self._applicantPost(request, context, fields)
   193     self._applicantPost(request, context, fields)
   195 
   194 
   196     if not key_name:
   195     if not key_name:
   197       key_fields =  self._logic.getKeyFieldsFromFields(fields)
   196       key_name = self._logic.getKeyNameFromFields(fields)
   198       key_name = self._logic.getKeyNameFromFields(key_fields)
       
   199 
   197 
   200     # create the group entity
   198     # create the group entity
   201     entity = self._logic.updateOrCreateFromKeyName(fields, key_name)
   199     entity = self._logic.updateOrCreateFromKeyName(fields, key_name)
   202 
   200 
   203     # redirect to notifications list to see the admin invite
   201     # redirect to notifications list to see the admin invite