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:
parent
dc2c7e03ad
commit
b27a350d09
1 changed files with 5 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue