Fixed syntax nits

pull/4/merge
Pablo Saavedra 8 years ago
parent 627e6ea2b0
commit 224137fcf9
  1. 5
      synapse/rest/client/v2_alpha/_base.py
  2. 6
      synapse/rest/client/v2_alpha/filter.py

@ -52,9 +52,8 @@ def client_v2_patterns(path_regex, releases=(0,),
def set_timeline_upper_limit(filter_json, filter_timeline_limit):
if filter_timeline_limit < 0:
return # no upper limits
if 'room' in filter_json \
and 'timeline' in filter_json['room'] \
and 'limit' in filter_json['room']['timeline']:
timeline = filter_json.get('room', {}).get('timeline', {})
if 'limit' in timeline:
filter_json['room']['timeline']["limit"] = min(
filter_json['room']['timeline']['limit'],
filter_timeline_limit)

@ -86,8 +86,10 @@ class CreateFilterRestServlet(RestServlet):
raise AuthError(403, "Can only create filters for local users")
content = parse_json_object_from_request(request)
set_timeline_upper_limit(content,
self.hs.config.filter_timeline_limit)
set_timeline_upper_limit(
content,
self.hs.config.filter_timeline_limit
)
filter_id = yield self.filtering.add_user_filter(
user_localpart=target_user.localpart,

Loading…
Cancel
Save