1
Fork 0
mirror of https://github.com/Steffo99/greed.git synced 2025-03-13 12:17:27 +00:00

update last seen on user login

This commit is contained in:
Pavlo Zhuk 2020-04-11 01:31:19 +03:00
parent dc2c7e03ad
commit b27a350d09

View file

@ -1,4 +1,4 @@
import datetime
from datetime import datetime
import importlib
import os
import queue as queuem
@ -94,6 +94,10 @@ class ChatWorker(threading.Thread):
self.session.add(self.admin)
# Commit the transaction
self.session.commit()
else:
# Update users last seen date
self.session.query(db.User).filter_by(user_id=self.user.user_id).update({'last_seen': datetime.now()})
self.session.commit()
# Capture exceptions that occour during the conversation
try:
# If the user is not an admin, send him to the user menu