505 filter = {'scope_path': kwargs['scope_path'], |
505 filter = {'scope_path': kwargs['scope_path'], |
506 'link_id': kwargs['link_id']} |
506 'link_id': kwargs['link_id']} |
507 |
507 |
508 proposal_logic = params['logic'] |
508 proposal_logic = params['logic'] |
509 student_proposal_entity = proposal_logic.getForFields(filter, unique=True) |
509 student_proposal_entity = proposal_logic.getForFields(filter, unique=True) |
510 |
510 reviewer = student_proposal_entity.scope |
|
511 |
511 # update the entity mark it as invalid |
512 # update the entity mark it as invalid |
512 proposal_logic.updateEntityProperties(student_proposal_entity, |
513 proposal_logic.updateEntityProperties(student_proposal_entity, |
513 {'status': 'invalid'}) |
514 {'status': 'invalid'}) |
514 |
515 |
515 # redirect to the program's homepage |
516 # redirect to the program's homepage |
516 redirect_url = redirects.getHomeRedirect(student_proposal_entity.program, |
517 redirect_url = redirects.getHomeRedirect(student_proposal_entity.program, |
517 {'url_name': 'program'}) |
518 {'url_name': 'program'}) |
518 |
519 |
|
520 comment = "Student withdrew proposal." |
|
521 self._createReviewFor(student_proposal_entity, reviewer, comment) |
519 return http.HttpResponseRedirect(redirect_url) |
522 return http.HttpResponseRedirect(redirect_url) |
520 |
523 |
521 return super(View, self).edit(request=request, access_type=access_type, |
524 return super(View, self).edit(request=request, access_type=access_type, |
522 page_name=page_name, params=params, seed=seed, **kwargs) |
525 page_name=page_name, params=params, seed=seed, **kwargs) |
523 |
526 |