diff options
author | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2014-04-09 21:24:38 +0200 |
---|---|---|
committer | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2014-04-09 21:24:38 +0200 |
commit | 2309ebd1b40076899906519c59b34aa237265a72 (patch) | |
tree | 7400a7e8bed34e0d93e096629ab2b54c90da2ce8 /pyaggr3g470r/views.py | |
parent | Fixed bug: all users were able to access to any article. (diff) | |
download | newspipe-2309ebd1b40076899906519c59b34aa237265a72.tar.gz newspipe-2309ebd1b40076899906519c59b34aa237265a72.tar.bz2 newspipe-2309ebd1b40076899906519c59b34aa237265a72.zip |
Fixed bug.
Diffstat (limited to 'pyaggr3g470r/views.py')
-rw-r--r-- | pyaggr3g470r/views.py | 6 |
1 files 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()) |