diff options
author | François Schmidts <francois.schmidts@gmail.com> | 2016-01-31 16:07:04 +0100 |
---|---|---|
committer | François Schmidts <francois.schmidts@gmail.com> | 2016-01-31 16:07:04 +0100 |
commit | 6a4e5c8626476a3e24e4170b7b1c541ddcc9bbee (patch) | |
tree | 2a1123ad2013c6ecb2cd4a932a1443771dffd34d /src/web/views/article.py | |
parent | decommissionning old home (diff) | |
download | newspipe-6a4e5c8626476a3e24e4170b7b1c541ddcc9bbee.tar.gz newspipe-6a4e5c8626476a3e24e4170b7b1c541ddcc9bbee.tar.bz2 newspipe-6a4e5c8626476a3e24e4170b7b1c541ddcc9bbee.zip |
right redirect link handling
Diffstat (limited to 'src/web/views/article.py')
-rw-r--r-- | src/web/views/article.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/web/views/article.py b/src/web/views/article.py index 664b66c8..5b04fe7a 100644 --- a/src/web/views/article.py +++ b/src/web/views/article.py @@ -17,7 +17,10 @@ article_bp = Blueprint('article', __name__, url_prefix='/article') @article_bp.route('/redirect/<int:article_id>', methods=['GET']) @login_required def redirect_to_article(article_id): - article = ArticleController(g.user.id).get(id=article_id) + contr = ArticleController(g.user.id) + article = contr.get(id=article_id) + if not article.readed: + contr.update({'id': article.id}, {'readed': True}) return redirect(article.link) |