aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Axtens <dja@axtens.net>2016-09-03 17:07:15 +1000
committerStephen Finucane <stephenfinucane@hotmail.com>2016-09-03 23:25:42 +0100
commitc547dc77d6024c6bf1bd0e0b4a829e76486e0ab3 (patch)
tree0ed619b75c384425958334b499e4db3793e9ed9c
parent69a57e9a3ebd4490e3192565c92218b2b81c7a04 (diff)
downloadpatchwork-c547dc77d6024c6bf1bd0e0b4a829e76486e0ab3.tar
patchwork-c547dc77d6024c6bf1bd0e0b4a829e76486e0ab3.tar.gz
xmlrpc: fix max_count for check_list
Negative values were broken due to some missing code. Fix it by adding code based on an example from one of the other models. Signed-off-by: Daniel Axtens <dja@axtens.net> Reviewed-by: Stephen Finucane <stephenfinucane@hotmail.com>
-rw-r--r--patchwork/views/xmlrpc.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/patchwork/views/xmlrpc.py b/patchwork/views/xmlrpc.py
index 890db75..e47019c 100644
--- a/patchwork/views/xmlrpc.py
+++ b/patchwork/views/xmlrpc.py
@@ -933,6 +933,9 @@ def check_list(filt=None):
if max_count > 0:
return list(map(check_to_dict, checks[:max_count]))
+ elif max_count < 0:
+ min_count = checks.count() + max_count
+ return list(map(check_to_dict, checks[min_count:]))
else:
return list(map(check_to_dict, checks))
except Check.DoesNotExist: