aboutsummaryrefslogtreecommitdiff
path: root/pyaggr3g470r
diff options
context:
space:
mode:
authorCédric Bonhomme <cedric@cedricbonhomme.org>2014-04-24 07:23:21 +0200
committerCédric Bonhomme <cedric@cedricbonhomme.org>2014-04-24 07:23:21 +0200
commit25bf0d2b6fd20a573f2ae615e23a745b44d1da5e (patch)
tree203885fc8914d2467d01a6c535c1a13756835773 /pyaggr3g470r
parentThis fixes #2. (diff)
downloadnewspipe-25bf0d2b6fd20a573f2ae615e23a745b44d1da5e.tar.gz
newspipe-25bf0d2b6fd20a573f2ae615e23a745b44d1da5e.tar.bz2
newspipe-25bf0d2b6fd20a573f2ae615e23a745b44d1da5e.zip
Update last_seen field before each request.
Diffstat (limited to 'pyaggr3g470r')
-rw-r--r--pyaggr3g470r/views.py12
1 files changed, 3 insertions, 9 deletions
diff --git a/pyaggr3g470r/views.py b/pyaggr3g470r/views.py
index a00fcb2a..a2012b06 100644
--- a/pyaggr3g470r/views.py
+++ b/pyaggr3g470r/views.py
@@ -74,10 +74,9 @@ def on_identity_loaded(sender, identity):
def before_request():
g.user = current_user
if g.user.is_authenticated():
- pass
- #g.user.last_seen = datetime.utcnow()
- #db.session.add(g.user)
- #db.session.commit()
+ g.user.last_seen = datetime.utcnow()
+ db.session.add(g.user)
+ db.session.commit()
@login_manager.user_loader
def load_user(email):
@@ -157,11 +156,6 @@ def logout():
"""
Log out view. Removes the user information from the session.
"""
- # Update last_seen field
- g.user.last_seen = datetime.datetime.utcnow()
- db.session.add(g.user)
- db.session.commit()
-
# Remove the user information from the session
logout_user()
bgstack15