Added user-agent, ip and last seen to sessions

This commit is contained in:
Mawoka
2022-03-05 19:38:20 +01:00
parent 19ddff60f0
commit b697115bfb
2 changed files with 7 additions and 3 deletions
+3
View File
@@ -32,6 +32,9 @@ class UserSession(ormar.Model):
user: uuid.UUID = ormar.ForeignKey(User)
session_key: str = ormar.String(unique=True, max_length=64)
created_at: datetime = ormar.DateTime(default=datetime.now())
ip_address: str = ormar.String(max_length=100, nullable=True)
user_agent: str = ormar.String(max_length=255, nullable=True)
last_seen: datetime = ormar.DateTime(default=datetime.now())
class Meta:
tablename = 'user_sessions'