|
43 | 43 |
|
44 | 44 | from django.core.cache import caches |
45 | 45 | from django.db.models import Max |
46 | | -from django.http import HttpResponse, Http404 |
| 46 | +from django.http import HttpResponse, Http404, HttpResponseBadRequest |
47 | 47 | from django.shortcuts import render, get_object_or_404, redirect |
48 | 48 | from django.template.loader import render_to_string |
49 | 49 | from django.urls import reverse as urlreverse |
|
73 | 73 | role_required, is_individual_draft_author, can_request_rfc_publication) |
74 | 74 | from ietf.name.models import StreamName, BallotPositionName |
75 | 75 | from ietf.utils.history import find_history_active_at |
| 76 | +from ietf.doc.views_ballot import parse_ballot_edit_return_point |
76 | 77 | from ietf.doc.forms import InvestigateForm, TelechatForm, NotifyForm, ActionHoldersForm, DocAuthorForm, DocAuthorChangeBasisForm |
77 | 78 | from ietf.doc.mails import email_comment, email_remind_action_holders |
78 | 79 | from ietf.mailtrigger.utils import gather_relevant_expansions |
@@ -1586,11 +1587,18 @@ def ballot_popup(request, name, ballot_id): |
1586 | 1587 | doc = get_object_or_404(Document, name=name) |
1587 | 1588 | c = document_ballot_content(request, doc, ballot_id=ballot_id, editable=False) |
1588 | 1589 | ballot = get_object_or_404(BallotDocEvent,id=ballot_id) |
| 1590 | + |
| 1591 | + try: |
| 1592 | + return_to_url = parse_ballot_edit_return_point(request.GET.get('ballot_edit_return_point'), name, ballot_id) |
| 1593 | + except ValueError: |
| 1594 | + return HttpResponseBadRequest('ballot_edit_return_point is invalid') |
| 1595 | + |
1589 | 1596 | return render(request, "doc/ballot_popup.html", |
1590 | 1597 | dict(doc=doc, |
1591 | 1598 | ballot_content=c, |
1592 | 1599 | ballot_id=ballot_id, |
1593 | 1600 | ballot_type_slug=ballot.ballot_type.slug, |
| 1601 | + ballot_edit_return_point=return_to_url, |
1594 | 1602 | editable=True, |
1595 | 1603 | )) |
1596 | 1604 |
|
|
0 commit comments