Skip to content

Commit a368e7a

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

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

oauth2_provider/middleware.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ def __call__(self, request):
4646

4747

4848
class CorsMiddleware:
49-
5049
def __init__(self, get_response):
5150
self.get_response = get_response
5251

oauth2_provider/models.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -222,17 +222,19 @@ def get_allowed_schemes(self):
222222
return oauth2_settings.ALLOWED_REDIRECT_URI_SCHEMES
223223

224224
def get_cors_header(self, origin):
225-
'''Return a proper cors-header for this origin, in the context of this
225+
"""Return a proper cors-header for this origin, in the context of this
226226
application.
227227
:param origin: Origin-url from HTTP-request.
228228
:raises: Application.NoSuitableOriginFoundError
229-
'''
229+
"""
230230
parsed_origin = urlparse(origin)
231231
for allowed_uri in self.redirect_uris.split():
232232
parsed_allowed_uri = urlparse(allowed_uri)
233-
if (parsed_allowed_uri.scheme == parsed_origin.scheme and
234-
parsed_allowed_uri.netloc == parsed_origin.netloc and
235-
parsed_allowed_uri.port == parsed_origin.port):
233+
if (
234+
parsed_allowed_uri.scheme == parsed_origin.scheme
235+
and parsed_allowed_uri.netloc == parsed_origin.netloc
236+
and parsed_allowed_uri.port == parsed_origin.port
237+
):
236238
return origin
237239
raise AbstractApplication.NoSuitableOriginFoundError
238240

@@ -257,10 +259,10 @@ def jwk_key(self):
257259
return jwk.JWK(kty="oct", k=base64url_encode(self.client_secret))
258260
raise ImproperlyConfigured("This application does not support signed tokens")
259261

260-
261262
class NoSuitableOriginFoundError(Exception):
262263
pass
263264

265+
264266
class ApplicationManager(models.Manager):
265267
def get_by_natural_key(self, client_id):
266268
return self.get(client_id=client_id)

tests/urls.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from django.contrib import admin
22
from django.urls import include, path
3+
34
from .views import MockView
45

56

0 commit comments

Comments
 (0)