We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 206b8f3 commit 66952f5Copy full SHA for 66952f5
python/nav/models/api.py
@@ -20,6 +20,7 @@
20
from django.contrib.postgres.fields import HStoreField
21
from django.db import models
22
from django.urls import reverse
23
+from django.utils import djangotimezone
24
25
from nav.models.fields import VarcharField
26
from nav.models.profiles import Account
@@ -84,7 +85,7 @@ def is_active(self) -> bool:
84
85
`activates` is in the past and `expires` is in the future.
86
"""
87
now = datetime.now(tz=timezone.utc)
- return now >= self.activates and now < self.expires
88
+ return djangotimezone.now() >= self.activates and now < self.expires
89
90
class Meta(object):
91
db_table = 'jwtrefreshtoken'
0 commit comments