From 2309ebd1b40076899906519c59b34aa237265a72 Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Wed, 9 Apr 2014 21:24:38 +0200 Subject: Fixed bug. --- pyaggr3g470r/views.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pyaggr3g470r/views.py b/pyaggr3g470r/views.py index 0f0d6822..3387f0f9 100644 --- a/pyaggr3g470r/views.py +++ b/pyaggr3g470r/views.py @@ -243,14 +243,12 @@ def article(article_id=None): Presents the content of an article. """ article = Article.query.filter(Article.id == article_id).first() - if article.source.subscriber.id == g.user.id: - if article == None: - flash("This article do not exist.", 'warning') - return redirect(redirect_url()) + if article != None and article.source.subscriber.id == g.user.id: if not article.readed: article.readed = True db.session.commit() return render_template('article.html', head_title=utils.clear_string(article.title), article=article) + flash("This article do not exist.", 'warning') return redirect(redirect_url()) -- cgit