diff options
| author | Gertjan van den Burg <gertjanvandenburg@gmail.com> | 2019-03-18 14:56:22 +0000 |
|---|---|---|
| committer | Gertjan van den Burg <gertjanvandenburg@gmail.com> | 2019-03-18 14:56:22 +0000 |
| commit | 9e8370c3937a581c7a7c81c117d0a5a0e9d278d9 (patch) | |
| tree | 8bbf460a30594c2cdcfa854752737f59b328fd66 /app/routes.py | |
| parent | add file encoding (diff) | |
| download | AnnotateChange-9e8370c3937a581c7a7c81c117d0a5a0e9d278d9.tar.gz AnnotateChange-9e8370c3937a581c7a7c81c117d0a5a0e9d278d9.zip | |
Record last visit
Diffstat (limited to 'app/routes.py')
| -rw-r--r-- | app/routes.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/app/routes.py b/app/routes.py index 804b54d..a1a4f54 100644 --- a/app/routes.py +++ b/app/routes.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- +import datetime from flask import render_template, flash, redirect, url_for, request from flask_login import current_user, login_user, logout_user, login_required @@ -22,6 +23,8 @@ def index(): @app.route("/login", methods=("GET", "POST")) def login(): if current_user.is_authenticated: + current_user.last_active = datetime.datetime.utcnow() + db.session.commit() return redirect(url_for("index")) form = LoginForm() if form.validate_on_submit(): |
