mirror of
https://github.com/RoboSats/robosats.git
synced 2024-12-14 03:16:24 +00:00
Fix last_login is None on update last login
This commit is contained in:
parent
4fe69da565
commit
2046857ee4
@ -87,8 +87,11 @@ class RobotTokenSHA256AuthenticationMiddleWare:
|
||||
try:
|
||||
token = Token.objects.get(key=token_sha256_b91)
|
||||
# Update last login every 2 minutes (avoid too many DB writes)
|
||||
try:
|
||||
if token.user.last_login < timezone.now() - timedelta(minutes=2):
|
||||
update_last_login(None, token.user)
|
||||
except Exception:
|
||||
update_last_login(None, token.user)
|
||||
|
||||
except Token.DoesNotExist:
|
||||
# If we get here the user does not have a robot on this coordinator
|
||||
|
Loading…
Reference in New Issue
Block a user