Skip to content

Commit d6f5833

Browse files
authored
Merge pull request #70 from civantos/fix-command
Fixed imports and timedelta usage in management command
2 parents c222460 + 669d619 commit d6f5833

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

django_rest_passwordreset/management/commands/clearresetpasswodtokens.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from django.core.management.base import BaseCommand
22
from django.utils import timezone
3+
import datetime
34

45
from django_rest_passwordreset.models import clear_expired, get_password_reset_token_expiry_time
56

@@ -9,5 +10,5 @@ class Command(BaseCommand):
910

1011
def handle(self, *args, **options):
1112
# datetime.now minus expiry hours
12-
now_minus_expiry_time = timezone.now() - timedelta(hours=get_password_reset_token_expiry_time())
13+
now_minus_expiry_time = timezone.now() - datetime.timedelta(hours=get_password_reset_token_expiry_time())
1314
clear_expired(now_minus_expiry_time)

0 commit comments

Comments
 (0)