From a8ebba8266618ec53fe485ee84d09d0cdff898a1 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Wed, 27 Sep 2023 10:09:53 +0300 Subject: typing: fix and ignore typing issues. --- gn_auth/auth/authorisation/roles/models.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'gn_auth/auth/authorisation/roles') diff --git a/gn_auth/auth/authorisation/roles/models.py b/gn_auth/auth/authorisation/roles/models.py index 7d78eac..f6d6c41 100644 --- a/gn_auth/auth/authorisation/roles/models.py +++ b/gn_auth/auth/authorisation/roles/models.py @@ -105,7 +105,7 @@ def user_roles(conn: db.DbConnection, user: User) -> Sequence[dict]: "WHERE ur.user_id=?", (str(user.user_id),)) - return tuple({ + return tuple({# type: ignore[var-annotated] **row, "roles": tuple(row["roles"].values()) } for row in reduce( __organise_privileges__, cursor.fetchall(), {}).values()) @@ -126,7 +126,8 @@ def user_role(conn: db.DbConnection, user: User, role_id: UUID) -> Either: results = cursor.fetchall() if results: - res_role_obj = tuple(reduce(__organise_privileges__, results, {}).values())[0] + res_role_obj = tuple(# type: ignore[var-annotated] + reduce(__organise_privileges__, results, {}).values())[0] resource_id = res_role_obj["resource_id"] role = tuple(res_role_obj["roles"].values())[0] return Right((role, resource_id)) -- cgit v1.2.3