Adds “Submit review and jump to random proposal” button
This commit is contained in:
parent
9ae17146df
commit
9223c8fc90
1 changed files with 8 additions and 2 deletions
|
@ -325,7 +325,7 @@ def review_detail(request, pk):
|
||||||
if request.user in speakers:
|
if request.user in speakers:
|
||||||
return access_not_permitted(request)
|
return access_not_permitted(request)
|
||||||
|
|
||||||
if "vote_submit" in request.POST:
|
if "vote_submit" in request.POST or "vote_submit_and_random" in request.POST:
|
||||||
review_form = ReviewForm(request.POST)
|
review_form = ReviewForm(request.POST)
|
||||||
if review_form.is_valid():
|
if review_form.is_valid():
|
||||||
|
|
||||||
|
@ -334,7 +334,13 @@ def review_detail(request, pk):
|
||||||
review.proposal = proposal
|
review.proposal = proposal
|
||||||
review.save()
|
review.save()
|
||||||
|
|
||||||
return redirect(request.path)
|
if "vote_submit_and_random" in request.POST:
|
||||||
|
next_page = redirect("user_random", proposal.kind.section.slug)
|
||||||
|
next_page["Location"] += "#invalid_fragment" # Hack.
|
||||||
|
else:
|
||||||
|
next_page = redirect(request.path)
|
||||||
|
|
||||||
|
return next_page
|
||||||
else:
|
else:
|
||||||
message_form = SpeakerCommentForm()
|
message_form = SpeakerCommentForm()
|
||||||
elif "message_submit" in request.POST and admin:
|
elif "message_submit" in request.POST and admin:
|
||||||
|
|
Loading…
Reference in a new issue