aboutsummaryrefslogtreecommitdiff
path: root/gn3/auth
diff options
context:
space:
mode:
authorMunyoki Kilyungi2023-09-05 14:41:41 +0300
committerBonfaceKilz2023-09-05 14:57:51 +0300
commit8bb89dd929506af37675ed5e65737ac79ca0678e (patch)
tree36c7bcdaefc62b33e1710d02d50df8f901c7c120 /gn3/auth
parentbf8296c5c3093aef32a5cd91fb008ad257e7a2f1 (diff)
downloadgenenetwork3-8bb89dd929506af37675ed5e65737ac79ca0678e.tar.gz
Fix C3001: Lambda expression assigned to a variable
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
Diffstat (limited to 'gn3/auth')
-rw-r--r--gn3/auth/authentication/oauth2/endpoints/utilities.py3
-rw-r--r--gn3/auth/authentication/oauth2/models/oauth2token.py3
2 files changed, 4 insertions, 2 deletions
diff --git a/gn3/auth/authentication/oauth2/endpoints/utilities.py b/gn3/auth/authentication/oauth2/endpoints/utilities.py
index 299f151..e13784e 100644
--- a/gn3/auth/authentication/oauth2/endpoints/utilities.py
+++ b/gn3/auth/authentication/oauth2/endpoints/utilities.py
@@ -12,7 +12,8 @@ def query_token(# pylint: disable=[unused-argument]
endpoint_object: Any, token_str: str, token_type_hint) -> Optional[
OAuth2Token]:
"""Retrieve the token from the database."""
- __identity__ = lambda val: val
+ def __identity__(val):
+ return val
token = Nothing
with db.connection(current_app.config["AUTH_DB"]) as conn:
if token_type_hint == "access_token":
diff --git a/gn3/auth/authentication/oauth2/models/oauth2token.py b/gn3/auth/authentication/oauth2/models/oauth2token.py
index 72e20cc..bfe4aaf 100644
--- a/gn3/auth/authentication/oauth2/models/oauth2token.py
+++ b/gn3/auth/authentication/oauth2/models/oauth2token.py
@@ -51,7 +51,8 @@ class OAuth2Token(NamedTuple):
return self.revoked
def __token_from_resultset__(conn: db.DbConnection, rset) -> Maybe:
- __identity__ = lambda val: val
+ def __identity__(val):
+ return val
try:
the_user = user_by_id(conn, uuid.UUID(rset["user_id"]))
except NotFoundError as _nfe: