add message to reviewers when proposal is updated

This commit is contained in:
Luke Hatcher 2012-08-27 14:12:19 -04:00
parent 2da59c13bf
commit 6bfd617e99
3 changed files with 19 additions and 0 deletions

View file

@ -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:

View 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>

View file

@ -0,0 +1 @@
{% load account_tags %}"{{ proposal.title }}" has been updated by {% user_display user %}