Merge pull request #2346 from minrk/push-activity

push last_activity to the hub
This commit is contained in:
Min RK
2019-02-15 11:16:12 +01:00
committed by GitHub
10 changed files with 444 additions and 20 deletions

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: