diff options
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) |