app/soc/views/models/student_proposal.py
changeset 1779 cdd11aa8dbc7
parent 1758 e035f81d367b
child 1787 b623d96bc830
equal deleted inserted replaced
1778:660502cad63a 1779:cdd11aa8dbc7
   531     # to change his role for this app
   531     # to change his role for this app
   532     choice = request.GET.get('mentor')
   532     choice = request.GET.get('mentor')
   533     if mentor_entity and choice:
   533     if mentor_entity and choice:
   534       self._adjustPossibleMentors(entity, mentor_entity, choice)
   534       self._adjustPossibleMentors(entity, mentor_entity, choice)
   535 
   535 
       
   536     is_ineligible = request.GET.get('ineligible')
       
   537     if org_admin_entity and is_ineligible:
       
   538       # mark the proposal invalid and return to the list
       
   539       properties = {'status': 'invalid'}
       
   540       self._logic.updateEntityProperties(entity, properties)
       
   541 
       
   542       redirect = redirects.getListProposalsRedirect(entity.org,
       
   543                                                     {'url_name': 'org'})
       
   544       return http.HttpResponseRedirect(redirect)
       
   545 
   536     # decide which form to use
   546     # decide which form to use
   537     if org_admin_entity:
   547     if org_admin_entity:
   538       form = params['admin_review_form']
   548       form = params['admin_review_form']
   539     else:
   549     else:
   540       form = params['mentor_review_form']
   550       form = params['mentor_review_form']
   689         # show "No longer willing to mentor"
   699         # show "No longer willing to mentor"
   690         context['remove_me_as_mentor'] = True
   700         context['remove_me_as_mentor'] = True
   691       else:
   701       else:
   692         # show "I am willing to mentor"
   702         # show "I am willing to mentor"
   693         context['add_me_as_mentor'] = True
   703         context['add_me_as_mentor'] = True
       
   704 
       
   705     if org_admin:
       
   706       context['is_org_admin'] = True
   694 
   707 
   695     return context
   708     return context
   696 
   709 
   697   def _adjustPossibleMentors(self, entity, mentor, choice):
   710   def _adjustPossibleMentors(self, entity, mentor, choice):
   698     """Adjusts the possible mentors list for a proposal.
   711     """Adjusts the possible mentors list for a proposal.