Skip to content

Commit d88e03c

Browse files
committed
use timezone instead of naive
1 parent 96b1ffe commit d88e03c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

oauth2_provider/views/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import logging
2-
import datetime
32

43
from django.http import HttpResponse, HttpResponseRedirect
54
from django.views.generic import View, FormView
5+
from django.utils import timezone
66

77
from oauthlib.oauth2 import Server
88

@@ -119,7 +119,7 @@ def get(self, request, *args, **kwargs):
119119
require_approval = request.GET.get('approval_prompt', 'auto')
120120
if require_approval == 'auto' and request.user.accesstoken_set.filter(
121121
application=kwargs['application'],
122-
expires__gt=datetime.datetime.now()).count():
122+
expires__gt=timezone.now()).count():
123123
uri, headers, body, status = self.create_authorization_response(
124124
request=self.request, scopes=" ".join(scopes),
125125
credentials=credentials, allow=True)

0 commit comments

Comments
 (0)