From: Jeremy Kerr Date: Mon, 19 Jul 2010 06:17:35 +0000 (+0200) Subject: views/bundle/public: Lookup on user X-Git-Tag: v0.9.0~216 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d2da1d19f82462bf0b357772bbab174281fc788a;p=thirdparty%2Fpatchwork.git views/bundle/public: Lookup on user Currently, the public bundle view is only looking up bundles by their name. This may return multiple bundles if two users have bundles with the same name. This change adds the user to the bundle lookup. Reported-by: Ralf Baechle Signed-off-by: Jeremy Kerr --- diff --git a/apps/patchwork/views/bundle.py b/apps/patchwork/views/bundle.py index 9995fc6c..18beb08f 100644 --- a/apps/patchwork/views/bundle.py +++ b/apps/patchwork/views/bundle.py @@ -180,7 +180,8 @@ def mbox(request, bundle_id): def public(request, username, bundlename): user = get_object_or_404(User, username = username) - bundle = get_object_or_404(Bundle, name = bundlename, public = True) + bundle = get_object_or_404(Bundle, name = bundlename, owner = user, + public = True) filter_settings = [(DelegateFilter, DelegateFilter.AnyDelegate)] context = generic_list(request, bundle.project, 'patchwork.views.bundle.public',