Skip to content

Commit d94410c

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 816db6e commit d94410c

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

oauth2_provider/oauth2_backends.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import json
22
from urllib.parse import urlparse, urlunparse
33

4+
from django.http import HttpRequest
45
from oauthlib import oauth2
56
from oauthlib.common import Request as OauthlibRequest
67
from oauthlib.common import quote, urlencode, urlencoded
78
from oauthlib.oauth2 import OAuth2Error
8-
from django.http import HttpRequest
99

1010
from .exceptions import FatalClientError, OAuthToolkitError
1111
from .settings import oauth2_settings

oauth2_provider/oauth2_validators.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
AbstractApplication.GRANT_CLIENT_CREDENTIALS,
5757
AbstractApplication.GRANT_OPENID_HYBRID,
5858
),
59-
"urn:ietf:params:oauth:grant-type:device_code": (AbstractApplication.GRANT_DEVICE_CODE,)
59+
"urn:ietf:params:oauth:grant-type:device_code": (AbstractApplication.GRANT_DEVICE_CODE,),
6060
}
6161

6262
Application = get_application_model()
@@ -167,8 +167,9 @@ def _authenticate_basic_auth(self, request):
167167
elif request.client.client_id != client_id:
168168
log.debug("Failed basic auth: wrong client id %s" % client_id)
169169
return False
170-
elif (request.client.client_type == "public"
171-
and request.grant_type == "urn:ietf:params:oauth:grant-type:device_code"
170+
elif (
171+
request.client.client_type == "public"
172+
and request.grant_type == "urn:ietf:params:oauth:grant-type:device_code"
172173
):
173174
return True
174175
elif not self._check_secret(client_secret, request.client.client_secret):

oauth2_provider/urls.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
path("token/", views.TokenView.as_view(), name="token"),
1212
path("revoke_token/", views.RevokeTokenView.as_view(), name="revoke-token"),
1313
path("introspect/", views.IntrospectTokenView.as_view(), name="introspect"),
14-
path("device_authorization/", views.DeviceAuthorizationView.as_view(), name="device-authorization")
14+
path("device_authorization/", views.DeviceAuthorizationView.as_view(), name="device-authorization"),
1515
]
1616

1717

0 commit comments

Comments
 (0)