Renamed redirect methods to comply with the rest of the module.
authorLennard de Rijk <ljvderijk@gmail.com>
Fri, 23 Jan 2009 17:41:30 +0000
changeset 929 7431d7770197
parent 928 df051fc9d7a1
child 930 7e88fba647b1
Renamed redirect methods to comply with the rest of the module. Added use for getInviteAcceptedRedirect in the soc/views/models/request.py process_invite view. Patch by: Lennard de Rijk Reviewed by: to-be-reviewed
app/soc/templates/soc/request/process_invite.html
app/soc/views/helper/redirects.py
app/soc/views/models/request.py
--- a/app/soc/templates/soc/request/process_invite.html	Fri Jan 23 17:07:54 2009 +0000
+++ b/app/soc/templates/soc/request/process_invite.html	Fri Jan 23 17:41:30 2009 +0000
@@ -28,7 +28,7 @@
 
 <tr>
   <td>
-    <input type="button" onclick="location.href='/{{ entity.role }}/accept_invite/{{ entity.scope_path }}/{{ entity.link_id }}'" value="Accept"/>
+    <input type="button" onclick="location.href='{{ invite_accepted_redirect }}'" value="Accept"/>
     <input type="button" onclick="location.href='/{{ module_name }}/process_invite/{{ entity.scope_path }}/{{ entity.role }}/{{ entity.link_id }}?status=rejected'" value="Reject"/>
   </td>
 </tr>
--- a/app/soc/views/helper/redirects.py	Fri Jan 23 17:07:54 2009 +0000
+++ b/app/soc/views/helper/redirects.py	Fri Jan 23 17:41:30 2009 +0000
@@ -94,20 +94,22 @@
   return result
 
 
-def inviteAcceptedRedirect(entity, _):
+def getInviteAcceptedRedirect(entity, _):
   """Returns the redirect for accepting an invite.
   """
 
   return '/%s/accept_invite/%s/%s' % (
       entity.role, entity.scope_path, entity.link_id)
 
-def inviteProcessRedirect(entity, _):
+
+def getInviteProcessRedirect(entity, _):
   """Returns the redirect for processing an invite
   """
 
   return '/request/process_invite/%s/%s/%s' % (
       entity.scope_path, entity.role, entity.link_id)
 
+
 def getApplicantRedirect(entity, params):
   """Returns the redirect for processing accepted Applications.
   """
--- a/app/soc/views/models/request.py	Fri Jan 23 17:07:54 2009 +0000
+++ b/app/soc/views/models/request.py	Fri Jan 23 17:41:30 2009 +0000
@@ -149,6 +149,8 @@
     # put the entity in the context
     context['entity'] = request_entity
     context['module_name'] = params['module_name']
+    context['invite_accepted_redirect'] = (
+        redirects.getInviteAcceptedRedirect(entity, self._params))
 
     #display the invite processing page using the appropriate template
     template = params['invite_processing_template']
@@ -180,7 +182,7 @@
               'state' : 'group_accepted'}
 
     uh_params = params.copy()
-    uh_params['list_action'] = (redirects.inviteProcessRedirect, None)
+    uh_params['list_action'] = (redirects.getInviteProcessRedirect, None)
     uh_params['list_description'] = ugettext_lazy(
         "An overview of your unhandled invites.")