Don't notify everyone when a proposal changes, only the admins

This commit is contained in:
Scott Bragg 2016-09-27 19:21:57 +10:00
parent 2aa0074bdc
commit 42372791d5

View file

@ -205,10 +205,14 @@ def proposal_edit(request, pk):
if form.is_valid():
form.save()
if hasattr(proposal, "reviews"):
users = User.objects.filter(
Q(review__proposal=proposal) |
Q(proposalmessage__proposal=proposal)
)
# Miniconf updates should only email the admins
if proposal.kind.slug == 'miniconf':
users = User.objects.filter(username__in=settings.ADMIN_USERNAMES)
else:
users = User.objects.filter(
Q(review__proposal=proposal) |
Q(proposalmessage__proposal=proposal)
)
users = users.exclude(id=request.user.id).distinct()
for user in users:
ctx = {