From 2b547cf7071ff640d748a402ab03d7aed94cd3c5 Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Mon, 4 Nov 2013 23:38:38 +0100 Subject: Mark all articles as read + changed to the layout template. --- pyaggr3g470r/views.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pyaggr3g470r/views.py b/pyaggr3g470r/views.py index 166c61e6..57fa4956 100644 --- a/pyaggr3g470r/views.py +++ b/pyaggr3g470r/views.py @@ -113,6 +113,13 @@ def article(article_id=None): article.save() return render_template('article.html', article=article) +@app.route('/mark_as_read/', methods=['GET']) +@login_required +def mark_as_read(): + #user = models.User.objects(email=g.user.email).first() + models.Article.objects(readed=False).update(set__readed=True) + return redirect(url_for('home')) + @app.route('/delete/', methods=['GET']) @login_required def delete(article_id=None): -- cgit