Bläddra i källkod

Rename timediff to lasted_used_diff

Pieter Lambrecht 3 år sedan
förälder
incheckning
5d868168a5
1 ändrade filer med 2 tillägg och 2 borttagningar
  1. 2 2
      netbox/netbox/api/authentication.py

+ 2 - 2
netbox/netbox/api/authentication.py

@@ -20,8 +20,8 @@ class TokenAuthentication(authentication.TokenAuthentication):
             raise exceptions.AuthenticationFailed("Invalid token")
             raise exceptions.AuthenticationFailed("Invalid token")
 
 
         # Update last used, but only once a minute. This reduces the write load on the db
         # Update last used, but only once a minute. This reduces the write load on the db
-        timediff = timezone.now() - token.last_used
-        if timediff.total_seconds() > 60:
+        last_used_diff = timezone.now() - token.last_used
+        if last_used_diff.total_seconds() > 60:
             token.last_used = timezone.now()
             token.last_used = timezone.now()
             token.save()
             token.save()