unpromote a proposal if undecided or rejected
This commit is contained in:
parent
69877075c7
commit
d4b5326395
1 changed files with 8 additions and 0 deletions
|
@ -300,9 +300,17 @@ def promote_proposal(proposal):
|
|||
return presentation
|
||||
|
||||
|
||||
def unpromote_proposal(proposal):
|
||||
|
||||
if hasattr(proposal, "presentation") and proposal.presentation:
|
||||
proposal.presentation.delete()
|
||||
|
||||
|
||||
def accepted_proposal(sender, instance=None, **kwargs):
|
||||
if instance is None:
|
||||
return
|
||||
if instance.accepted == True:
|
||||
promote_proposal(instance.proposal)
|
||||
else:
|
||||
unpromote_proposal(instance.proposal)
|
||||
post_save.connect(accepted_proposal, sender=ProposalResult)
|
||||
|
|
Loading…
Reference in a new issue