# HG changeset patch # User Lennard de Rijk # Date 1236631426 0 # Node ID cdd11aa8dbc731012f1637b2a3f1aa451a08016a # Parent 660502cad63a3fc66aee845e1cce20d9ef64c083 Org admins can mark a StudentProposal as invalid if they for any reason find it ineligible. Patch by: Lennard de Rijk Reviewed by: to-be-reviewed diff -r 660502cad63a -r cdd11aa8dbc7 app/soc/models/student_proposal.py --- a/app/soc/models/student_proposal.py Mon Mar 09 19:37:56 2009 +0000 +++ b/app/soc/models/student_proposal.py Mon Mar 09 20:43:46 2009 +0000 @@ -80,9 +80,8 @@ #: new : the proposal has not been ranked/scored yet #: pending: the proposal is in the process of being ranked/scored #: accepted: the proposal has been assigned a project slot - #: rejected: the proposal has not been assigned a slot or the organization - #: does not want this proposal. - #: invalid: the student or developer marked this as an invalid proposal. + #: rejected: the proposal has not been assigned a slot + #: invalid: the student or org admin marked this as an invalid proposal. status = db.StringProperty(required=True, default='new', choices=['new', 'pending', 'accepted', 'rejected', 'invalid']) diff -r 660502cad63a -r cdd11aa8dbc7 app/soc/templates/soc/student_proposal/review.html --- a/app/soc/templates/soc/student_proposal/review.html Mon Mar 09 19:37:56 2009 +0000 +++ b/app/soc/templates/soc/student_proposal/review.html Mon Mar 09 20:43:46 2009 +0000 @@ -71,6 +71,12 @@ {% endif %} {% endif %} + {% if is_org_admin %} + + + + {% endif %} diff -r 660502cad63a -r cdd11aa8dbc7 app/soc/views/models/student_proposal.py --- a/app/soc/views/models/student_proposal.py Mon Mar 09 19:37:56 2009 +0000 +++ b/app/soc/views/models/student_proposal.py Mon Mar 09 20:43:46 2009 +0000 @@ -533,6 +533,16 @@ if mentor_entity and choice: self._adjustPossibleMentors(entity, mentor_entity, choice) + is_ineligible = request.GET.get('ineligible') + if org_admin_entity and is_ineligible: + # mark the proposal invalid and return to the list + properties = {'status': 'invalid'} + self._logic.updateEntityProperties(entity, properties) + + redirect = redirects.getListProposalsRedirect(entity.org, + {'url_name': 'org'}) + return http.HttpResponseRedirect(redirect) + # decide which form to use if org_admin_entity: form = params['admin_review_form'] @@ -692,6 +702,9 @@ # show "I am willing to mentor" context['add_me_as_mentor'] = True + if org_admin: + context['is_org_admin'] = True + return context def _adjustPossibleMentors(self, entity, mentor, choice):