app/soc/views/models/club_admin.py
changeset 925 a85719e94570
parent 920 39badbfb80be
child 928 df051fc9d7a1
equal deleted inserted replaced
924:34f944dc4502 925:a85719e94570
    70     new_params['scope_view'] = club_view
    70     new_params['scope_view'] = club_view
    71     new_params['scope_redirect'] = redirects.getCreateRedirect
    71     new_params['scope_redirect'] = redirects.getCreateRedirect
    72 
    72 
    73     new_params['name'] = "Club Admin"
    73     new_params['name'] = "Club Admin"
    74 
    74 
    75     new_params['extra_dynaexclude'] = ['user', 'club', 'state']
    75     new_params['extra_dynaexclude'] = ['user', 'state']
    76 
    76 
    77     new_params['create_extra_dynafields'] = {
    77     new_params['create_extra_dynafields'] = {
    78        'scope_path': forms.CharField(widget=forms.HiddenInput,
    78        'scope_path': forms.CharField(widget=forms.HiddenInput,
    79                                   required=True),
    79                                   required=True),
    80        'clean_link_id' : cleaning.clean_existing_user('link_id'),
    80        'clean_link_id' : cleaning.clean_existing_user('link_id'),
   112     """
   112     """
   113 
   113 
   114     fields['user'] = fields['link_id']
   114     fields['user'] = fields['link_id']
   115     fields['link_id'] = fields['user'].link_id
   115     fields['link_id'] = fields['user'].link_id
   116 
   116 
   117     club = club_logic.logic.getFromKeyName(fields['scope_path'])
       
   118     fields['club'] =  club
       
   119 
       
   120     super(View, self)._editPost(request, entity, fields)
   117     super(View, self)._editPost(request, entity, fields)
   121 
   118 
   122 
   119 
   123   @decorators.merge_params
   120   @decorators.merge_params
   124   @decorators.check_access
   121   @decorators.check_access
   189     # fill in the appropriate fields that were missing in the form
   186     # fill in the appropriate fields that were missing in the form
   190     fields['user'] = fields['link_id']
   187     fields['user'] = fields['link_id']
   191     fields['link_id'] = fields['user'].link_id
   188     fields['link_id'] = fields['user'].link_id
   192 
   189 
   193     club = club_logic.logic.getFromKeyName(fields['scope_path'])
   190     club = club_logic.logic.getFromKeyName(fields['scope_path'])
   194     fields['club'] =  club
       
   195     fields['scope'] = club
   191     fields['scope'] = club
   196     
   192     
   197     # make sure that this role becomes active once more in case this user
   193     # make sure that this role becomes active once more in case this user
   198     # has been reinvited
   194     # has been reinvited
   199     fields ['state'] = 'active'
   195     fields ['state'] = 'active'