app/soc/views/models/role.py
changeset 2076 1cd180cc56c9
parent 2016 01e3adf37176
child 2177 e2c193e1f631
equal deleted inserted replaced
2075:c6bdfd560d91 2076:1cd180cc56c9
    29 
    29 
    30 from soc.logic import cleaning
    30 from soc.logic import cleaning
    31 from soc.logic import dicts
    31 from soc.logic import dicts
    32 from soc.logic.models import request as request_logic
    32 from soc.logic.models import request as request_logic
    33 from soc.logic.models import user as user_logic
    33 from soc.logic.models import user as user_logic
    34 from soc.logic.helper import notifications as notifications_helper
       
    35 from soc.logic.helper import request as request_helper
    34 from soc.logic.helper import request as request_helper
    36 from soc.views.helper import decorators
    35 from soc.views.helper import decorators
    37 from soc.views.helper import redirects
    36 from soc.views.helper import redirects
    38 from soc.views.helper import responses
    37 from soc.views.helper import responses
    39 from soc.views.models import base
    38 from soc.views.models import base
   105           'Accept invite for %(name)s'),
   104           'Accept invite for %(name)s'),
   106           (r'^%(url_name)s/(?P<access_type>process_request)/%(scope)s/%(lnp)s$',
   105           (r'^%(url_name)s/(?P<access_type>process_request)/%(scope)s/%(lnp)s$',
   107           'soc.views.models.%(module_name)s.process_request',
   106           'soc.views.models.%(module_name)s.process_request',
   108           'Process request for %(name)s'),
   107           'Process request for %(name)s'),
   109           (r'^%(url_name)s/(?P<access_type>request)/%(scope)s$',
   108           (r'^%(url_name)s/(?P<access_type>request)/%(scope)s$',
   110           'soc.views.models.%(module_name)s.request',
   109           'soc.views.models.%(module_name)s.role_request',
   111           'Create a Request to become %(name)s')]
   110           'Create a Request to become %(name)s')]
   112     elif params.get('allow_invites'):
   111     elif params.get('allow_invites'):
   113       # add patterns concerning only invites
   112       # add patterns concerning only invites
   114       patterns += [(r'^%(url_name)s/(?P<access_type>invite)/%(scope)s$',
   113       patterns += [(r'^%(url_name)s/(?P<access_type>invite)/%(scope)s$',
   115           'soc.views.models.%(module_name)s.invite',
   114           'soc.views.models.%(module_name)s.invite',
   263 
   262 
   264     # extract the key_name for the new request entity
   263     # extract the key_name for the new request entity
   265     key_name = request_logic.logic.getKeyNameFromFields(request_fields)
   264     key_name = request_logic.logic.getKeyNameFromFields(request_fields)
   266 
   265 
   267     # create the request entity
   266     # create the request entity
   268     entity = request_logic.logic.updateOrCreateFromKeyName(request_fields,
   267     request_logic.logic.updateOrCreateFromKeyName(request_fields, key_name)
   269                                                            key_name)
       
   270 
   268 
   271     group_view = params.get('group_view')
   269     group_view = params.get('group_view')
   272     if not group_view:
   270     if not group_view:
   273       return http.HttpResponseRedirect('/')
   271       return http.HttpResponseRedirect('/')
   274     else:
   272     else: