aboutsummaryrefslogtreecommitdiff
path: root/pyaggr3g470r/views.py
diff options
context:
space:
mode:
authorCédric Bonhomme <cedric@cedricbonhomme.org>2013-12-27 12:21:17 +0100
committerCédric Bonhomme <cedric@cedricbonhomme.org>2013-12-27 12:21:17 +0100
commit58de71cb09b70743a11e715b36797146e475718d (patch)
tree21888fd553e136d085fc694798cb4ef2abc5b5b2 /pyaggr3g470r/views.py
parentMinor fix in the template of unread articles. (diff)
downloadnewspipe-58de71cb09b70743a11e715b36797146e475718d.tar.gz
newspipe-58de71cb09b70743a11e715b36797146e475718d.tar.bz2
newspipe-58de71cb09b70743a11e715b36797146e475718d.zip
Flash messsages.
Diffstat (limited to 'pyaggr3g470r/views.py')
-rw-r--r--pyaggr3g470r/views.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/pyaggr3g470r/views.py b/pyaggr3g470r/views.py
index 4e8fa6ef..d80051f3 100644
--- a/pyaggr3g470r/views.py
+++ b/pyaggr3g470r/views.py
@@ -59,12 +59,12 @@ def before_request():
@app.errorhandler(403)
def authentication_failed(e):
- flash('Authenticated failed.')
+ flash('Authenticated failed.', 'danger')
return redirect(url_for('login'))
@app.errorhandler(401)
def authentication_failed(e):
- flash('Authenticated required.')
+ flash('Authenticated required.', 'info')
return redirect(url_for('login'))
@login_manager.user_loader
@@ -81,7 +81,7 @@ def login():
user = models.User.objects(email=form.email.data).first()
login_user(user)
g.user = user
- flash("Logged in successfully.")
+ flash("Logged in successfully.", 'success')
return redirect(url_for('home'))
return render_template('login.html', form=form)
@@ -198,7 +198,10 @@ def delete(article_id=None):
feed.articles.remove(article)
article.delete()
user.save()
+ flash('Article "' + article.title + '" deleted.', 'success')
return redirect(url_for('home'))
+ flash('Impossible to delete the article.', 'danger')
+ return redirect(url_for('home'))
@app.route('/articles/<feed_id>', methods=['GET'])
@login_required
bgstack15