API: Upload new version of an extension #138

Merged
Dalai Felinto merged 12 commits from tokens-version-api into main 2024-05-27 16:18:05 +02:00
Showing only changes of commit 2ca34ac8c2 - Show all commits

View File

@ -1,4 +1,4 @@
import datetime from django.utils import timezone
from rest_framework.authentication import BaseAuthentication from rest_framework.authentication import BaseAuthentication
from rest_framework.exceptions import AuthenticationFailed from rest_framework.exceptions import AuthenticationFailed
@ -27,7 +27,7 @@ class UserTokenAuthentication(BaseAuthentication):
raise AuthenticationFailed('Invalid token') raise AuthenticationFailed('Invalid token')
token.ip_address_last_access = clean_ip_address(request) token.ip_address_last_access = clean_ip_address(request)
token.date_last_access = datetime.datetime.now() token.date_last_access = timezone.now()
token.save(update_fields={'ip_address_last_access', 'date_last_access'}) token.save(update_fields={'ip_address_last_access', 'date_last_access'})
return (token.user, token) return (token.user, token)