diff options
author | Erik Johnston <erik@matrix.org> | 2015-10-12 10:50:46 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2015-10-12 10:50:46 +0100 |
commit | ae72e247fa478a541c837aaa7663aa3ca01ba840 (patch) | |
tree | 5b3432ab00e3fbeac6264e66aaf2d578a51bab10 /synapse | |
parent | Keep FTS indexes up to date. Only search through rooms currently joined (diff) | |
download | synapse-ae72e247fa478a541c837aaa7663aa3ca01ba840.tar.xz |
PEP8
Diffstat (limited to '')
-rw-r--r-- | synapse/handlers/search.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/synapse/handlers/search.py b/synapse/handlers/search.py index b6bdb752e9..9dc474aa56 100644 --- a/synapse/handlers/search.py +++ b/synapse/handlers/search.py @@ -30,7 +30,11 @@ logger = logging.getLogger(__name__) KEYS_TO_ALLOWED_CONSTRAINT_TYPES = { KnownRoomEventKeys.CONTENT_BODY: [SearchConstraintTypes.FTS], KnownRoomEventKeys.CONTENT_MSGTYPE: [SearchConstraintTypes.EXACT], - KnownRoomEventKeys.CONTENT_NAME: [SearchConstraintTypes.FTS, SearchConstraintTypes.EXACT, SearchConstraintTypes.SUBSTRING], + KnownRoomEventKeys.CONTENT_NAME: [ + SearchConstraintTypes.FTS, + SearchConstraintTypes.EXACT, + SearchConstraintTypes.SUBSTRING, + ], KnownRoomEventKeys.CONTENT_TOPIC: [SearchConstraintTypes.FTS], KnownRoomEventKeys.SENDER: [SearchConstraintTypes.EXACT], KnownRoomEventKeys.ORIGIN_SERVER_TS: [SearchConstraintTypes.RANGE], @@ -54,7 +58,10 @@ class RoomConstraint(object): raise SynapseError(400, "Unrecognized key %r", key) if search_type not in KEYS_TO_ALLOWED_CONSTRAINT_TYPES[key]: - raise SynapseError(400, "Disallowed constraint type %r for key %r", search_type, key) + raise SynapseError( + 400, + "Disallowed constraint type %r for key %r", search_type, key + ) return cls(search_type, keys, d["value"]) |