Adds “publish changes” behaviour to views so that we can publish edits to abstracts.

This commit is contained in:
Christopher Neugebauer 2016-09-18 15:46:53 +10:00
parent f42766beef
commit 699b32b938
2 changed files with 15 additions and 6 deletions

View file

@ -361,6 +361,12 @@ def promote_proposal(proposal):
if hasattr(proposal, "presentation") and proposal.presentation:
# already promoted
presentation = proposal.presentation
presentation.title = proposal.title
presentation.abstract = proposal.abstract
presentation.speaker = proposal.speaker
presentation.proposal_base = proposal
presentation.save()
presentation.additional_speakers.clear()
else:
presentation = Presentation(
title=proposal.title,
@ -370,9 +376,9 @@ def promote_proposal(proposal):
proposal_base=proposal,
)
presentation.save()
for speaker in proposal.additional_speakers.all():
presentation.additional_speakers.add(speaker)
presentation.save()
for speaker in proposal.additional_speakers.all():
presentation.additional_speakers.add(speaker)
presentation.save()
return presentation

View file

@ -23,7 +23,7 @@ from symposion.reviews.forms import ReviewForm, SpeakerCommentForm
from symposion.reviews.forms import BulkPresentationForm
from symposion.reviews.models import (
ReviewAssignment, Review, LatestVote, ProposalResult, NotificationTemplate,
ResultNotification
ResultNotification, promote_proposal
)
@ -422,8 +422,11 @@ def review_detail(request, pk):
elif result == "standby":
proposal.result.status = "standby"
proposal.result.save()
return redirect(request.path)
return redirect(request.path)
elif "publish_changes" in request.POST:
if admin and proposal.result.status == "accepted":
promote_proposal(proposal)
return redirect(request.path)
else:
initial = {}
if latest_vote: