diff options
author | Erik Johnston <erik@matrix.org> | 2014-12-03 18:02:33 +0000 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2014-12-03 18:02:33 +0000 |
commit | 036516d647c6fbd8ec4642a3308e73f71868b1b3 (patch) | |
tree | 6cfacc683f68a9e9748058335c36e8ee2fa7f83d /synapse/streams/config.py | |
parent | Bump version (diff) | |
parent | Bump changes and version (diff) | |
download | synapse-036516d647c6fbd8ec4642a3308e73f71868b1b3.tar.xz |
Merge branch 'release-v0.5.4' of github.com:matrix-org/synapse v0.5.4
Diffstat (limited to 'synapse/streams/config.py')
-rw-r--r-- | synapse/streams/config.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/synapse/streams/config.py b/synapse/streams/config.py index 0317e78c08..2114c940e7 100644 --- a/synapse/streams/config.py +++ b/synapse/streams/config.py @@ -47,7 +47,8 @@ class PaginationConfig(object): self.limit = int(limit) if limit is not None else None @classmethod - def from_request(cls, request, raise_invalid_params=True): + def from_request(cls, request, raise_invalid_params=True, + default_limit=None): def get_param(name, default=None): lst = request.args.get(name, []) if len(lst) > 1: @@ -84,6 +85,9 @@ class PaginationConfig(object): if limit is not None and not limit.isdigit(): raise SynapseError(400, "'limit' parameter must be an integer.") + if limit is None: + limit = default_limit + try: return PaginationConfig(from_tok, to_tok, direction, limit) except: |