Skip to content
Snippets Groups Projects
Verified Commit c40f2ff0 authored by Jakob Moser's avatar Jakob Moser
Browse files

Rearrange lines (first "assert" authorization type, then check payload)

parent 4dcb6d31
No related branches found
No related tags found
1 merge request!22Make MyPy happy
......@@ -16,9 +16,9 @@ from .blueprint import bp
def set_user_if_valid() -> None:
if (
not request.authorization
or request.authorization.type != "basic"
or request.authorization.username is None
or request.authorization.password is None
or request.authorization.type != "basic"
):
g.user = None
return
......@@ -32,8 +32,8 @@ def set_user_if_valid() -> None:
def set_key_if_valid() -> None:
if (
not request.authorization
or request.authorization.token is None
or request.authorization.type != "bearer"
or request.authorization.token is None
):
g.key = None
return
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment