Make 'keys' optional

This commit is contained in:
Erik Johnston 2015-10-14 10:35:50 +01:00
parent 99c7fbfef7
commit 8c9df8774e

View file

@ -84,7 +84,9 @@ class SearchHandler(BaseHandler):
def search(self, user, content):
try:
search_term = content["search_categories"]["room_events"]["search_term"]
keys = content["search_categories"]["room_events"]["keys"]
keys = content["search_categories"]["room_events"].get("keys", [
"content.body", "content.name", "content.topic",
])
except KeyError:
raise SynapseError(400, "Invalid search query")