summaryrefslogtreecommitdiff
path: root/src/mailman/rest/helpers.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/mailman/rest/helpers.py')
-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