Added the users' public name to the process_request page.
authorLennard de Rijk <ljvderijk@gmail.com>
Thu, 19 Mar 2009 08:52:55 +0000
changeset 1937 7343876363cd
parent 1936 ea886e0aedc4
child 1938 21699b426f60
Added the users' public name to the process_request page. Patch by: Lennard de Rijk Reviewed by: to-be-reviewed
app/soc/templates/soc/request/process_request.html
app/soc/views/models/role.py
--- a/app/soc/templates/soc/request/process_request.html	Thu Mar 19 08:38:01 2009 +0000
+++ b/app/soc/templates/soc/request/process_request.html	Thu Mar 19 08:52:55 2009 +0000
@@ -22,8 +22,8 @@
 <p>
 <div="text"> 
 {% ifequal request_status "new" %}
-  This is the request from <b>{{ entity.link_id }}</b> to become a 
-  <b>{{ entity.role_verbose }}</b> for <b>{{entity.scope.name }}</b>.</br>
+  This is the request from <b>{{ user_in_request.name }}({{ entity.link_id }})</b> 
+  to become a <b>{{ entity.role_verbose }}</b> for <b>{{entity.scope.name }}</b>.</br>
   Please select your response by using the buttons below.
 </div>
 </p>
@@ -40,7 +40,7 @@
 {% else %}
 <p>
 <div="text"> 
-  This is the invitation to <b>{{ entity.link_id }}</b> to become a 
+  This is the invitation to <b>{{ user_in_request.name }}({{ entity.link_id }})</b> to become a 
   <b>{{ entity.role_verbose }}</b> for <b>{{entity.scope.name }}</b>.<br/> 
   If you would like to withdraw this invite please press the withdraw button below.
 </div>
--- a/app/soc/views/models/role.py	Thu Mar 19 08:38:01 2009 +0000
+++ b/app/soc/views/models/role.py	Thu Mar 19 08:52:55 2009 +0000
@@ -604,6 +604,8 @@
         'role': params['module_name']}
     request_entity = request_logic.logic.getForFields(fields, unique=True)
 
+    user_entity = user_logic.logic.getFromKeyNameOr404(request_entity.link_id)
+
     get_dict = request.GET
 
     if 'status' in get_dict.keys():
@@ -630,6 +632,7 @@
 
     # put the entity in the context
     context['entity'] = request_entity
+    context['user_in_request'] = user_entity
     context['request_status'] = request_entity.status 
     context['module_name'] = params['module_name']