Skip to content

Commit fb33b29

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

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

oauth2_provider/models.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,11 @@ def clean(self):
231231
allowed_origins = self.allowed_origins.strip().split()
232232
if allowed_origins:
233233
# oauthlib allows only https scheme for CORS
234-
validator = AllowedURIValidator(oauth2_settings.ALLOWED_SCHEMES, "allowed origin", allow_hostname_wildcard=oauth2_settings.ALLOW_REDIRECT_URI_WILDCARDS)
234+
validator = AllowedURIValidator(
235+
oauth2_settings.ALLOWED_SCHEMES,
236+
"allowed origin",
237+
allow_hostname_wildcard=oauth2_settings.ALLOW_REDIRECT_URI_WILDCARDS,
238+
)
235239
for uri in allowed_origins:
236240
validator(uri)
237241

oauth2_provider/validators.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,7 @@ def __call__(self, value):
7979
params={"name": self.name, "value": value, "cause": "path not allowed"},
8080
)
8181

82-
if (
83-
oauth2_settings.ALLOW_REDIRECT_URI_WILDCARDS
84-
and self.allow_hostname_wildcard
85-
and "*" in netloc
86-
):
82+
if oauth2_settings.ALLOW_REDIRECT_URI_WILDCARDS and self.allow_hostname_wildcard and "*" in netloc:
8783
domain_parts = netloc.split(".")
8884
if netloc.count("*") > 1:
8985
raise ValidationError(

0 commit comments

Comments
 (0)