From 8d35e0413fa670ef4fc08e7262a12c43b89df6fc Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Wed, 23 Aug 2023 09:12:07 +0300 Subject: pylint: Replace `lambda ...` statements with `def ...` --- gn_auth/auth/authentication/oauth2/endpoints/utilities.py | 4 +++- gn_auth/auth/authentication/oauth2/models/oauth2token.py | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'gn_auth/auth') diff --git a/gn_auth/auth/authentication/oauth2/endpoints/utilities.py b/gn_auth/auth/authentication/oauth2/endpoints/utilities.py index 29ace7c..2c13c66 100644 --- a/gn_auth/auth/authentication/oauth2/endpoints/utilities.py +++ b/gn_auth/auth/authentication/oauth2/endpoints/utilities.py @@ -12,7 +12,9 @@ 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): + """Identity function.""" + return val token = Nothing with db.connection(current_app.config["AUTH_DB"]) as conn: if token_type_hint == "access_token": diff --git a/gn_auth/auth/authentication/oauth2/models/oauth2token.py b/gn_auth/auth/authentication/oauth2/models/oauth2token.py index 6f9dc12..bbcdc4c 100644 --- a/gn_auth/auth/authentication/oauth2/models/oauth2token.py +++ b/gn_auth/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__(value): + return value try: the_user = user_by_id(conn, uuid.UUID(rset["user_id"])) except NotFoundError as _nfe: -- cgit v1.2.3