mirror of
https://github.com/RoboSats/robosats.git
synced 2024-12-14 19:36:24 +00:00
Fix last_login is None on update last login
This commit is contained in:
parent
4fe69da565
commit
2046857ee4
@ -87,7 +87,10 @@ class RobotTokenSHA256AuthenticationMiddleWare:
|
|||||||
try:
|
try:
|
||||||
token = Token.objects.get(key=token_sha256_b91)
|
token = Token.objects.get(key=token_sha256_b91)
|
||||||
# Update last login every 2 minutes (avoid too many DB writes)
|
# Update last login every 2 minutes (avoid too many DB writes)
|
||||||
if token.user.last_login < timezone.now() - timedelta(minutes=2):
|
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)
|
update_last_login(None, token.user)
|
||||||
|
|
||||||
except Token.DoesNotExist:
|
except Token.DoesNotExist:
|
||||||
|
Loading…
Reference in New Issue
Block a user