diff options
author | Patrick Cloke <clokep@users.noreply.github.com> | 2023-09-13 07:57:19 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-13 07:57:19 -0400 |
commit | d38d0dffc94b6269ed7ff5163d60958be3e6c304 (patch) | |
tree | d793f714887dfdceee8b27b678e6c03e3288a2bc /synapse/events/validator.py | |
parent | Don't schedule an async task on every sync (#16312) (diff) | |
download | synapse-d38d0dffc94b6269ed7ff5163d60958be3e6c304.tar.xz |
Use StrCollection in additional places. (#16301)
Diffstat (limited to 'synapse/events/validator.py')
-rw-r--r-- | synapse/events/validator.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/synapse/events/validator.py b/synapse/events/validator.py index 34625dd7a1..5da50cb0d2 100644 --- a/synapse/events/validator.py +++ b/synapse/events/validator.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. import collections.abc -from typing import Iterable, List, Type, Union, cast +from typing import List, Type, Union, cast import jsonschema from pydantic import Field, StrictBool, StrictStr @@ -36,7 +36,7 @@ from synapse.events.utils import ( from synapse.federation.federation_server import server_matches_acl_event from synapse.http.servlet import validate_json_object from synapse.rest.models import RequestBodyModel -from synapse.types import EventID, JsonDict, RoomID, UserID +from synapse.types import EventID, JsonDict, RoomID, StrCollection, UserID class EventValidator: @@ -225,7 +225,7 @@ class EventValidator: self._ensure_state_event(event) - def _ensure_strings(self, d: JsonDict, keys: Iterable[str]) -> None: + def _ensure_strings(self, d: JsonDict, keys: StrCollection) -> None: for s in keys: if s not in d: raise SynapseError(400, "'%s' not in content" % (s,)) |