Permalink
Browse files

nicer msg to user when mail fails

  • Loading branch information...
1 parent 4893eb5 commit c2ab42ab4529df9120f47b80879d5c4b2adb4436 @qzio committed Mar 30, 2013
Showing with 8 additions and 3 deletions.
  1. +8 −3 app.py
View
11 app.py
@@ -113,7 +113,10 @@ def lists_send_all():
if len(todolists) <= 0:
return "GTFO", 403
else:
- send_all(todolists, send_for_email)
+ if send_all(todolists, send_for_email):
+ flash("Will try and send you an email")
+ else:
+ flash("Failed to send you the email, please contact the admin")
return redirect(url_for('start'))
@@ -125,8 +128,10 @@ def lists_send(namehash):
if not re.match(regexps['email'], send_to_email):
flash('You need to supply a valid email')
else:
- flash("Will send this list to {0}".format(send_to_email))
- send_list(todolist, send_to_email)
+ if send_list(todolist, send_to_email):
+ flash("Will send this list to {0}".format(send_to_email))
+ else:
+ flash("Failed to send the email. Contacat the admin")
return redirect(url_for('lists_show', namehash=todolist.namehash))

0 comments on commit c2ab42a

Please sign in to comment.