diff options
author | BonfaceKilz | 2021-11-01 09:05:32 +0300 |
---|---|---|
committer | BonfaceKilz | 2021-11-01 09:10:04 +0300 |
commit | 8169d8aacd8598730fd2e6eba06052e7502f2cc1 (patch) | |
tree | a628195fcaeb737f098d34a95509d77e7ed549c1 | |
parent | 8ca5e82868e0dc3eb596d7bfeebb883385e4cb57 (diff) | |
download | genenetwork3-8169d8aacd8598730fd2e6eba06052e7502f2cc1.tar.gz |
Fix mypy issues
-rw-r--r-- | gn3/authentication.py | 8 | ||||
-rw-r--r-- | mypy.ini | 6 |
2 files changed, 10 insertions, 4 deletions
diff --git a/gn3/authentication.py b/gn3/authentication.py index 892aa8f..7bc7b77 100644 --- a/gn3/authentication.py +++ b/gn3/authentication.py @@ -3,9 +3,9 @@ import functools import json from urllib.parse import urljoin from enum import Enum, unique -from typing import Dict +from typing import Dict, Union -import redis +from redis import Redis import requests @@ -40,7 +40,7 @@ class AdminRole(OrderedEnum): EDIT_ADMINS = "edit-admins" -def get_user_membership(conn: redis.Redis, user_id: str, +def get_user_membership(conn: Redis, user_id: str, group_id: str) -> Dict: """Return a dictionary that indicates whether the `user_id` is a member or admin of `group_id`. @@ -84,7 +84,7 @@ def get_highest_user_access_role( A dict indicating the highest access role the user has. """ - role_mapping = {} + role_mapping: Dict[str, Union[DataRole, AdminRole]] = {} for data_role, admin_role in zip(DataRole, AdminRole): role_mapping.update({data_role.value: data_role, }) role_mapping.update({admin_role.value: admin_role, }) @@ -13,4 +13,10 @@ ignore_missing_imports = True ignore_missing_imports = True [mypy-pingouin.*] +ignore_missing_imports = True + +[mypy-redis.*] +ignore_missing_imports = True + +[mypy-requests.*] ignore_missing_imports = True
\ No newline at end of file |