From: Andrew Donnellan Date: Thu, 31 Aug 2017 04:31:24 +0000 (+1000) Subject: views: Fix "Add to bundle" dropdown on patch list view X-Git-Tag: v2.0.1~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e5da62ddd8ff11db3a860df73947edd9e5c519ee;p=thirdparty%2Fpatchwork.git views: Fix "Add to bundle" dropdown on patch list view The "Add to bundle" option in the patch list view requires the user's list of bundles to be added to the context. Before PatchworkRequestContext was removed, this was done in a context processor. When that was refactored out, the bundles list was re-added in the patch detail view, but not in the patch list view. Add the bundles list in the patch list view to rectify this. Reported-by: David Miller Reported-by: Michael Ellerman Reported-by: Paul Mackerras Suggested-by: Michael Ellerman Closes #116 ("Add to existing bundle drop down has disappeared from bottom of patch list page") Signed-off-by: Andrew Donnellan Reviewed-by: Stephen Finucane (cherry picked from commit b62c11755c21f2114a6f71aeb21a8c1e18617751) --- diff --git a/patchwork/views/patch.py b/patchwork/views/patch.py index c447b1c8..7e962e72 100644 --- a/patchwork/views/patch.py +++ b/patchwork/views/patch.py @@ -42,6 +42,10 @@ def patch_list(request, project_id): project = get_object_or_404(Project, linkname=project_id) context = generic_list(request, project, 'patch-list', view_args={'project_id': project.linkname}) + + if is_authenticated(request.user): + context['bundles'] = Bundle.objects.filter(owner=request.user) + return render(request, 'patchwork/list.html', context)