app/soc/views/models/club.py
changeset 1115 0a723ff3d27c
parent 1110 027efd049770
child 1125 c6e8e3573fa2
equal deleted inserted replaced
1114:65c8d1bfe94b 1115:0a723ff3d27c
   149       params: a dict with params for this View
   149       params: a dict with params for this View
   150       kwargs: the Key Fields for the specified entity
   150       kwargs: the Key Fields for the specified entity
   151     """
   151     """
   152 
   152 
   153     # find the application
   153     # find the application
   154     key_fields = club_app_logic.logic.getKeyFieldsFromDict(kwargs)
   154     key_fields = club_app_logic.logic.getKeyFieldsFromFields(kwargs)
   155     application = club_app_logic.logic.getFromFields(**key_fields)
   155     application = club_app_logic.logic.getFromKeyFields(key_fields)
   156 
   156 
   157     # extract the application fields
   157     # extract the application fields
   158     field_names = application.properties().keys()
   158     field_names = application.properties().keys()
   159     fields = dict( [(i, getattr(application, i)) for i in field_names] )
   159     fields = dict( [(i, getattr(application, i)) for i in field_names] )
   160 
   160 
   190     # fill in the founder of the club
   190     # fill in the founder of the club
   191     user = user_logic.logic.getForCurrentAccount()
   191     user = user_logic.logic.getForCurrentAccount()
   192     fields['founder'] = user
   192     fields['founder'] = user
   193 
   193 
   194     if not key_name:
   194     if not key_name:
   195       key_fields =  self._logic.getKeyFieldsFromDict(fields)
   195       key_fields =  self._logic.getKeyFieldsFromFields(fields)
   196       key_name = self._logic.getKeyNameForFields(key_fields)
   196       key_name = self._logic.getKeyNameFromFields(key_fields)
   197 
   197 
   198     # create the club entity
   198     # create the club entity
   199     entity = self._logic.updateOrCreateFromKeyName(fields, key_name)
   199     entity = self._logic.updateOrCreateFromKeyName(fields, key_name)
   200 
   200 
   201     # redirect to notifications list to see the admin invite
   201     # redirect to notifications list to see the admin invite