From bed83a3309ca72294e756e3f2b7ec04157fc5b09 Mon Sep 17 00:00:00 2001 From: Magnus Hagander Date: Mon, 28 Apr 2014 18:19:46 +0200 Subject: Show warning when trying to send email to zero recipients --- pgcommitfest/commitfest/views.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'pgcommitfest/commitfest/views.py') diff --git a/pgcommitfest/commitfest/views.py b/pgcommitfest/commitfest/views.py index 2556cc3..f34fd54 100644 --- a/pgcommitfest/commitfest/views.py +++ b/pgcommitfest/commitfest/views.py @@ -456,6 +456,10 @@ def send_email(request, cfid): else: reviewers = [] + if len(authors)==0 and len(reviewers)==0: + messages.add_message(request, messages.WARNING, "No recipients specified, cannot send email") + return HttpResponseRedirect('..') + messages.add_message(request, messages.INFO, "Email will be sent from: %s" % request.user.email) def _user_and_mail(u): return "%s %s (%s)" % (u.first_name, u.last_name, u.email) -- cgit v1.2.3