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.
--- 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().
--- 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']
--- 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