# HG changeset patch # User Sverre Rabbelier # Date 1227218245 0 # Node ID 07b2c382a4d6b17e2556fabe2560a3264a46ae94 # Parent b0c623819b688938d47ef7a932d90fe33a31cf26 Minor improvements to roles page Mainly not hard-coding the page name and showing all requests that are _accepted_, instead of the one's that aren't yet. diff -r b0c623819b68 -r 07b2c382a4d6 app/soc/views/models/request.py --- a/app/soc/views/models/request.py Thu Nov 20 21:18:19 2008 +0000 +++ b/app/soc/views/models/request.py Thu Nov 20 21:57:25 2008 +0000 @@ -147,7 +147,6 @@ new_params['list_template'] = 'soc/models/list.html' # TODO(SRabbelier) Change the redirect to something more useful new_params['list_redirect_action'] = '/' - new_params['list_redirect_entity'] = 'Request' new_params['name'] = 'Request' new_params['name_short'] = 'Request' new_params['name_plural'] = 'Request' @@ -156,16 +155,16 @@ params = dicts.merge(params, new_params) # get the current user - properties = {'account': users.get_current_user()} + properties = {'account': users.get_current_user()} user_entity = user_logic.logic.getForFields(properties, unique=True) # only select the requests for this user that haven't been handled yet filter = {'requester': user_entity, - 'accepted' : False, + 'accepted' : True, 'declined' : False} - return list(request, "Unhandled Requests", params, filter) + return list(request, page_name, params, filter) def _editSeed(self, request, seed): """See base.View._editGet(). diff -r b0c623819b68 -r 07b2c382a4d6 app/soc/views/models/role.py --- a/app/soc/views/models/role.py Thu Nov 20 21:18:19 2008 +0000 +++ b/app/soc/views/models/role.py Thu Nov 20 21:57:25 2008 +0000 @@ -91,7 +91,6 @@ new_params['list_template'] = 'soc/models/list.html' new_params['list_redirect_action'] = '/request/create/%s/%s' % ( self._params['url_name'], kwargs['link_id']) - new_params['list_redirect_entity'] = self._params['name'] new_params['name'] = self._params['name'] new_params['name_short'] = self._params['name_short'] new_params['name_plural'] = self._params['name_plural'] diff -r b0c623819b68 -r 07b2c382a4d6 app/soc/views/models/user.py --- a/app/soc/views/models/user.py Thu Nov 20 21:18:19 2008 +0000 +++ b/app/soc/views/models/user.py Thu Nov 20 21:57:25 2008 +0000 @@ -301,7 +301,12 @@ patterns = super(View, self).getDjangoURLPatterns() patterns += [(r'^' + self._params['url_name'] + '/edit$','soc.views.models.user.edit_self')] - patterns += [(r'^' + self._params['url_name'] + '/roles$','soc.views.models.request.list_self')] + + page_name = "Unhandled Requests" + patterns += [(r'^' + self._params['url_name'] + '/roles$', + 'soc.views.models.request.list_self', + {'page_name': page_name}, page_name)] + return patterns