Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] authored and dopry committed Oct 17, 2023
1 parent 4d38e4e commit d312e48
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions oauth2_provider/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
from .scopes import get_scopes_backend
from .settings import oauth2_settings
from .utils import jwk_from_pem
from .validators import RedirectURIValidator, WildcardSet, URIValidator
from .validators import RedirectURIValidator, URIValidator, WildcardSet


logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -135,6 +136,7 @@ class AbstractApplication(models.Model):
blank=True,
help_text=_("Allowed origins list to enable CORS, space separated"),
)

class Meta:
abstract = True

Expand Down Expand Up @@ -807,7 +809,9 @@ def is_origin_allowed(origin, allowed_origins):
parsed_origin = urlparse(origin)
for allowed_origin in allowed_origins:
parsed_allowed_origin = urlparse(allowed_origin)
if (parsed_allowed_origin.scheme == parsed_origin.scheme
and parsed_allowed_origin.netloc == parsed_origin.netloc):
if (
parsed_allowed_origin.scheme == parsed_origin.scheme
and parsed_allowed_origin.netloc == parsed_origin.netloc
):
return True
return False

0 comments on commit d312e48

Please sign in to comment.