diff mbox

[Branch,~linaro-validation/lava-dashboard/trunk] Rev 403: Fix bug #1012604 - Misleading "Bundle does not exist" for private bundles.

Message ID 20130502103917.18781.98648.launchpad@ackee.canonical.com
State Accepted
Headers show

Commit Message

Senthil Kumaran May 2, 2013, 10:39 a.m. UTC
------------------------------------------------------------
revno: 403
committer: Senthil Kumaran <senthil.kumaran@linaro.org>
branch nick: trunk
timestamp: Thu 2013-05-02 16:00:20 +0530
message:
  Fix bug #1012604 - Misleading "Bundle does not exist" for private bundles.
modified:
  dashboard_app/xmlrpc.py


--
lp:lava-dashboard
https://code.launchpad.net/~linaro-validation/lava-dashboard/trunk

You are subscribed to branch lp:lava-dashboard.
To unsubscribe from this branch go to https://code.launchpad.net/~linaro-validation/lava-dashboard/trunk/+edit-subscription
diff mbox

Patch

=== modified file 'dashboard_app/xmlrpc.py'
--- dashboard_app/xmlrpc.py	2013-04-04 03:33:50 +0000
+++ dashboard_app/xmlrpc.py	2013-05-02 10:30:20 +0000
@@ -270,12 +270,8 @@ 
 
         Exceptions raised
         -----------------
-        404
-            Either:
-
-                - Bundle not found
-                - Downloading from the stream that contains this bundle is
-                  not permitted
+        - 404 Bundle not found
+        - 403 Permission denied
 
         Rules for bundle stream access
         ------------------------------
@@ -287,7 +283,9 @@ 
         try:
             bundle = Bundle.objects.get(content_sha1=content_sha1)
             if not bundle.bundle_stream.is_accessible_by(self.user):
-                raise Bundle.DoesNotExist()
+                raise xmlrpclib.Fault(
+                    403, "Permission denied.  User does not have permissions"
+                    "to access this bundle.")
         except Bundle.DoesNotExist:
             raise xmlrpclib.Fault(errors.NOT_FOUND,
                     "Bundle not found")