aboutsummaryrefslogtreecommitdiff
path: root/pyaggr3g470r/views.py
diff options
context:
space:
mode:
authorCédric Bonhomme <cedric@cedricbonhomme.org>2014-04-09 21:24:38 +0200
committerCédric Bonhomme <cedric@cedricbonhomme.org>2014-04-09 21:24:38 +0200
commit2309ebd1b40076899906519c59b34aa237265a72 (patch)
tree7400a7e8bed34e0d93e096629ab2b54c90da2ce8 /pyaggr3g470r/views.py
parentFixed bug: all users were able to access to any article. (diff)
downloadnewspipe-2309ebd1b40076899906519c59b34aa237265a72.tar.gz
newspipe-2309ebd1b40076899906519c59b34aa237265a72.tar.bz2
newspipe-2309ebd1b40076899906519c59b34aa237265a72.zip
Fixed bug.
Diffstat (limited to 'pyaggr3g470r/views.py')
-rw-r--r--pyaggr3g470r/views.py6
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())
bgstack15