aboutsummaryrefslogtreecommitdiff
path: root/gn_auth/auth/authorisation/roles/models.py
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2023-09-27 10:09:53 +0300
committerFrederick Muriuki Muriithi2023-09-27 10:37:07 +0300
commita8ebba8266618ec53fe485ee84d09d0cdff898a1 (patch)
treefd019b3672e62573813123c43e9fa9843153bb10 /gn_auth/auth/authorisation/roles/models.py
parent938efc6d8d2713d5f8dd399e9c878b95832ac882 (diff)
downloadgn-auth-a8ebba8266618ec53fe485ee84d09d0cdff898a1.tar.gz
typing: fix and ignore typing issues.
Diffstat (limited to 'gn_auth/auth/authorisation/roles/models.py')
-rw-r--r--gn_auth/auth/authorisation/roles/models.py5
1 files changed, 3 insertions, 2 deletions
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))