Skip to content

Instantly share code, notes, and snippets.

@andymckay
Created January 19, 2012 23:42
Show Gist options
  • Save andymckay/1643766 to your computer and use it in GitHub Desktop.
Save andymckay/1643766 to your computer and use it in GitHub Desktop.
diff --git a/apps/api/views.py b/apps/api/views.py
index 02296b7..198d3a9 100644
--- a/apps/api/views.py
+++ b/apps/api/views.py
@@ -219,7 +219,10 @@ class AddonDetailView(APIView):
def process_request(self, addon_id):
try:
- addon = Addon.objects.id_or_slug(addon_id).get()
+ # untested!
+ addon = (Addon.objects.id_or_slug(addon_id)
+ .filter(disabled_by_user=False)
+ .get())
except Addon.DoesNotExist:
return self.render_msg('Add-on not found!', ERROR, status=404,
mimetype=self.mimetype)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment