diff options
author | David Baker <dave@matrix.org> | 2018-05-24 16:20:53 +0100 |
---|---|---|
committer | David Baker <dave@matrix.org> | 2018-05-24 16:20:53 +0100 |
commit | 77a23e2e058bbc02a675bd6e14bff2c9906c68b2 (patch) | |
tree | 5b65ad8562dc2d584b35b47999b5e004ad21b387 /synapse/events/validator.py | |
parent | pep8 (diff) | |
parent | Merge pull request #3277 from matrix-org/dbkr/remove_from_user_dir (diff) | |
download | synapse-77a23e2e058bbc02a675bd6e14bff2c9906c68b2.tar.xz |
Merge remote-tracking branch 'origin/develop' into dbkr/unbind
Diffstat (limited to 'synapse/events/validator.py')
-rw-r--r-- | synapse/events/validator.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/synapse/events/validator.py b/synapse/events/validator.py index 2f4c8a1018..e0e5bf818c 100644 --- a/synapse/events/validator.py +++ b/synapse/events/validator.py @@ -17,6 +17,8 @@ from synapse.types import EventID, RoomID, UserID from synapse.api.errors import SynapseError from synapse.api.constants import EventTypes, Membership +from six import string_types + class EventValidator(object): @@ -49,7 +51,7 @@ class EventValidator(object): strings.append("state_key") for s in strings: - if not isinstance(getattr(event, s), basestring): + if not isinstance(getattr(event, s), string_types): raise SynapseError(400, "Not '%s' a string type" % (s,)) if event.type == EventTypes.Member: @@ -88,5 +90,5 @@ class EventValidator(object): for s in keys: if s not in d: raise SynapseError(400, "'%s' not in content" % (s,)) - if not isinstance(d[s], basestring): + if not isinstance(d[s], string_types): raise SynapseError(400, "Not '%s' a string type" % (s,)) |