summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFlorian Fuchs2013-03-20 16:28:47 -0700
committerFlorian Fuchs2013-03-20 16:28:47 -0700
commitc7133b754546d60f74f4297be1c4c00ffe3a6abf (patch)
treee28d7d5c24eac4b9dbc0db7c0cb22f95249e513f /src
parente0b49799398b97b55d99002e12ce37e394c5cd3d (diff)
downloadmailman-c7133b754546d60f74f4297be1c4c00ffe3a6abf.tar.gz
mailman-c7133b754546d60f74f4297be1c4c00ffe3a6abf.tar.zst
mailman-c7133b754546d60f74f4297be1c4c00ffe3a6abf.zip
Diffstat (limited to 'src')
-rw-r--r--src/mailman/rest/helpers.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/mailman/rest/helpers.py b/src/mailman/rest/helpers.py
index 17663e1b4..57026d40a 100644
--- a/src/mailman/rest/helpers.py
+++ b/src/mailman/rest/helpers.py
@@ -137,10 +137,14 @@ def paginate(default_count=None):
# Set indices
list_start = 0
list_end = None
+ # get the result
+ result = function(*args, **kwargs)
+ # slice list only if count is not None
if count is not None:
list_start = int((page - 1) * count)
list_end = int(page * count)
- return function(*args, **kwargs)[list_start:list_end]
+ return result[list_start:list_end]
+ return result
return wrapper
return dec