diff mbox series

views: Fix "Add to bundle" dropdown on patch list view

Message ID 20170831043124.1187-1-andrew.donnellan@au1.ibm.com
State Accepted
Headers show
Series views: Fix "Add to bundle" dropdown on patch list view | expand

Commit Message

Andrew Donnellan Aug. 31, 2017, 4:31 a.m. UTC
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 <davem@davemloft.net>
Reported-by: Michael Ellerman <mpe@ellerman.id.au>
Reported-by: Paul Mackerras <paulus@ozlabs.org>
Suggested-by: Michael Ellerman <mpe@ellerman.id.au>
Cc: stable
Closes #116 ("Add to existing bundle drop down has disappeared from bottom of patch list page")
Signed-off-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>

---

jk: if you could apply this to ozlabs.org would be much appreciated

---
 patchwork/views/patch.py | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Jeremy Kerr Aug. 31, 2017, 5:35 a.m. UTC | #1
Hi Andrew,

> jk: if you could apply this to ozlabs.org would be much appreciated

Sure thing, done.

Cheers,


Jeremy
Stephen Finucane Aug. 31, 2017, 8:40 a.m. UTC | #2
On Thu, 2017-08-31 at 14:31 +1000, Andrew Donnellan wrote:
> 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 <davem@davemloft.net>
> Reported-by: Michael Ellerman <mpe@ellerman.id.au>
> Reported-by: Paul Mackerras <paulus@ozlabs.org>
> Suggested-by: Michael Ellerman <mpe@ellerman.id.au>
> Cc: stable
> Closes #116 ("Add to existing bundle drop down has disappeared from bottom of
> patch list page")
> Signed-off-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>

Sorry for missing this. Applied to 'master' and backported to 'stable/2.0'.
I'll probably get a v2.0.1 release out before the end of the week.

Stephen
Stephen Finucane Aug. 31, 2017, 8:41 a.m. UTC | #3
On Thu, 2017-08-31 at 09:40 +0100, Stephen Finucane wrote:
> On Thu, 2017-08-31 at 14:31 +1000, Andrew Donnellan wrote:
> > 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 <davem@davemloft.net>
> > Reported-by: Michael Ellerman <mpe@ellerman.id.au>
> > Reported-by: Paul Mackerras <paulus@ozlabs.org>
> > Suggested-by: Michael Ellerman <mpe@ellerman.id.au>
> > Cc: stable
> > Closes #116 ("Add to existing bundle drop down has disappeared from bottom
> > of
> > patch list page")
> > Signed-off-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
> 
> Sorry for missing this. Applied to 'master' and backported to 'stable/2.0'.
> I'll probably get a v2.0.1 release out before the end of the week.

Reviewed-by: Stephen Finucane <stephen@that.guru>

Stephen
diff mbox series

Patch

diff --git a/patchwork/views/patch.py b/patchwork/views/patch.py
index c447b1c..7e962e7 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)