add message to reviewers when proposal is updated
This commit is contained in:
parent
2da59c13bf
commit
6bfd617e99
3 changed files with 19 additions and 0 deletions
|
@ -187,6 +187,16 @@ def proposal_edit(request, pk):
|
|||
form = form_class(request.POST, instance=proposal)
|
||||
if form.is_valid():
|
||||
form.save()
|
||||
if hasattr(proposal, "reviews"):
|
||||
for review in proposal.reviews.distinct("user"):
|
||||
ctx = {
|
||||
"user": request.user,
|
||||
"proposal": proposal,
|
||||
}
|
||||
send_email(
|
||||
[review.user.email], "proposal_updated",
|
||||
context=ctx
|
||||
)
|
||||
messages.success(request, "Proposal updated.")
|
||||
return redirect("proposal_detail", proposal.pk)
|
||||
else:
|
||||
|
|
8
symposion/templates/emails/proposal_updated/message.html
Normal file
8
symposion/templates/emails/proposal_updated/message.html
Normal file
|
@ -0,0 +1,8 @@
|
|||
{% load account_tags %}
|
||||
<p>
|
||||
<b>{% user_display user %}</b> has made changes to <b>{{ proposal.title }}</b> which you have previously reviewed.
|
||||
</p>
|
||||
<p>
|
||||
{% url review_detail proposal.pk as detail_url %}
|
||||
View the latest version of the proposal online at <a href="http://{{ current_site }}{{ detail_url }}">http://{{ current_site }}{{ detail_url }}</a>
|
||||
</p>
|
1
symposion/templates/emails/proposal_updated/subject.txt
Normal file
1
symposion/templates/emails/proposal_updated/subject.txt
Normal file
|
@ -0,0 +1 @@
|
|||
{% load account_tags %}"{{ proposal.title }}" has been updated by {% user_display user %}
|
Loading…
Reference in a new issue