summaryrefslogtreecommitdiffstats
path: root/apps/patchwork/views
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2011-03-09 13:20:10 +0800
committerJeremy Kerr <jk@ozlabs.org>2011-03-09 13:20:10 +0800
commit25f3514a617e91dae3d255b3685f3a1f9799727b (patch)
treeee8c4071771fecaf75a63c1bd6884304ce8dbdb5 /apps/patchwork/views
parent8639b526494afbe41d27c60e69ce26513c7d3c37 (diff)
downloadpatchwork-25f3514a617e91dae3d255b3685f3a1f9799727b.tar.bz2
patchwork-25f3514a617e91dae3d255b3685f3a1f9799727b.tar.xz
views: use id__in = get_patch_ids() to get the modified patch set
Currently, we generic_list processes patches in order of the patch_id:X parameter, which is arbitrarily decided by the browser. By using id__in, we get patches sorted by the default Patch model ordering. This means that the (arbitrary) order of get_patch_ids() doesn't affect the ordering of patches that we process, and bundles are created with a reasonable default patch order. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'apps/patchwork/views')
-rw-r--r--apps/patchwork/views/__init__.py8
1 files changed, 1 insertions, 7 deletions
diff --git a/apps/patchwork/views/__init__.py b/apps/patchwork/views/__init__.py
index 3f50380..fbe44f5 100644
--- a/apps/patchwork/views/__init__.py
+++ b/apps/patchwork/views/__init__.py
@@ -47,13 +47,7 @@ def generic_list(request, project, view,
if request.POST.get('bundle_name', False):
action = 'create'
- ps = []
- for patch_id in get_patch_ids(request.POST):
- try:
- patch = Patch.objects.get(id = patch_id)
- except Patch.DoesNotExist:
- pass
- ps.append(patch)
+ ps = Patch.objects.filter(id__in = get_patch_ids(request.POST))
(errors, form) = set_patches(request.user, project, action, \
request.POST, ps, context)