diff options
author | Jonathan de Jong <jonathan@automatia.nl> | 2021-07-15 12:02:43 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-15 11:02:43 +0100 |
commit | bf72d10dbf506f5ea486d67094b6003947d38fb7 (patch) | |
tree | b7890a287d8fea6488797f6c2659082c4f7532db /synapse/event_auth.py | |
parent | Allow providing credentials to `http_proxy` (#10360) (diff) | |
download | synapse-bf72d10dbf506f5ea486d67094b6003947d38fb7.tar.xz |
Use inline type hints in various other places (in `synapse/`) (#10380)
Diffstat (limited to 'synapse/event_auth.py')
-rw-r--r-- | synapse/event_auth.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/synapse/event_auth.py b/synapse/event_auth.py index a3df6cfcc1..137dff2513 100644 --- a/synapse/event_auth.py +++ b/synapse/event_auth.py @@ -531,7 +531,7 @@ def _check_power_levels( user_level = get_user_power_level(event.user_id, auth_events) # Check other levels: - levels_to_check = [ + levels_to_check: List[Tuple[str, Optional[str]]] = [ ("users_default", None), ("events_default", None), ("state_default", None), @@ -539,7 +539,7 @@ def _check_power_levels( ("redact", None), ("kick", None), ("invite", None), - ] # type: List[Tuple[str, Optional[str]]] + ] old_list = current_state.content.get("users", {}) for user in set(list(old_list) + list(user_list)): @@ -569,12 +569,12 @@ def _check_power_levels( new_loc = new_loc.get(dir, {}) if level_to_check in old_loc: - old_level = int(old_loc[level_to_check]) # type: Optional[int] + old_level: Optional[int] = int(old_loc[level_to_check]) else: old_level = None if level_to_check in new_loc: - new_level = int(new_loc[level_to_check]) # type: Optional[int] + new_level: Optional[int] = int(new_loc[level_to_check]) else: new_level = None |