app/soc/views/models/group_app.py
changeset 1296 64918d0c97ea
parent 1290 b2919e3ffdae
child 1307 091a21cf3627
equal deleted inserted replaced
1295:b3b2025f4ffb 1296:64918d0c97ea
   193       contents += [list_content]
   193       contents += [list_content]
   194 
   194 
   195       index += 1
   195       index += 1
   196 
   196 
   197     # call the _list method from base to display the list
   197     # call the _list method from base to display the list
   198     return self._list(request, params, contents, page_name)
   198     if kwargs['context']:
       
   199       context = kwargs['context']
       
   200     else:
       
   201       context = {}
       
   202 
       
   203     return self._list(request, params, contents, page_name, context=context)
   199 
   204 
   200 
   205 
   201   @decorators.merge_params
   206   @decorators.merge_params
   202   @decorators.check_access
   207   @decorators.check_access
   203   def listSelf(self, request, access_type,
   208   def listSelf(self, request, access_type,
   258         # only update if the status changes
   263         # only update if the status changes
   259         if entity.status != status_value:
   264         if entity.status != status_value:
   260           fields = {'status' : status_value}
   265           fields = {'status' : status_value}
   261 
   266 
   262           self._logic.updateEntityProperties(entity, fields)
   267           self._logic.updateEntityProperties(entity, fields)
       
   268           self._review(request, params, entity, status_value, **kwargs)
   263 
   269 
   264           if status_value == 'accepted':
   270           if status_value == 'accepted':
   265             # the application has been accepted send out a notification
   271             # the application has been accepted send out a notification
   266             notifications.sendNewGroupNotification(entity, params)
   272             notifications.sendNewGroupNotification(entity, params)
   267 
   273 
   283     # using the appropriate review template
   289     # using the appropriate review template
   284     params['public_template'] = params['review_template']
   290     params['public_template'] = params['review_template']
   285 
   291 
   286     return super(View, self).public(request, access_type,
   292     return super(View, self).public(request, access_type,
   287         page_name=page_name, params=params, **kwargs)
   293         page_name=page_name, params=params, **kwargs)
       
   294 
       
   295 
       
   296   def _review(self, request, params, app_entity, status, **kwargs):
       
   297     """Does any required post review processing.
       
   298 
       
   299     Args:
       
   300       request: the standard Django HTTP request object
       
   301       params: a dict with params for this View
       
   302       app_entity: The update application entity
       
   303       status: The status that was given to the reviewed app_entity
       
   304 
       
   305     """
       
   306     pass
   288 
   307 
   289 
   308 
   290   @decorators.merge_params
   309   @decorators.merge_params
   291   @decorators.check_access
   310   @decorators.check_access
   292   def reviewOverview(self, request, access_type,
   311   def reviewOverview(self, request, access_type,