notmybestwork: avoid updating user activity with server api access

this isn't the most important metric (server.last_activity is),
but avoid *probable* server api access incrementing user.last_activity
This commit is contained in:
Min RK
2019-02-11 16:18:37 +01:00
parent d8d1b6c149
commit 33a139861b

View File

@@ -310,7 +310,11 @@ class BaseHandler(RequestHandler):
now = datetime.utcnow()
orm_token.last_activity = now
if orm_token.user:
orm_token.user.last_activity = now
# FIXME: scopes should give us better control than this
# don't consider API requests originating from a server
# to be activity from the user
if not orm_token.note.startswith("Server at "):
orm_token.user.last_activity = now
self.db.commit()
if orm_token.service: