Skip to content
This repository has been archived by the owner on Jan 18, 2020. It is now read-only.

Commit

Permalink
Update NamedSampleResource to bypass Serrano's authentication check
Browse files Browse the repository at this point in the history
This resource must be publicly accessible, so the Serrano-based
authentication must be ignored.
  • Loading branch information
bruth committed Feb 27, 2014
1 parent 69485e5 commit 28c065e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions varify/samples/resources.py
Expand Up @@ -9,6 +9,7 @@
from django.views.decorators.cache import never_cache
from django.conf import settings
from preserialize.serialize import serialize
from restlib2 import resources
from serrano.resources.base import ThrottledResource
from varify.variants.resources import VariantResource
from varify import api
Expand Down Expand Up @@ -69,6 +70,10 @@ class NamedSampleResource(ThrottledResource):

template = api.templates.Sample

# Bypass authorization check imposed by Serrano's AUTH_REQUIRED setting
def __call__(self, *args, **kwargs):
return resources.Resource.__call__(self, *args, **kwargs)

def is_not_found(self, request, response, project, batch, sample):
try:
instance = self.model.objects.get(project__name=project,
Expand Down

0 comments on commit 28c065e

Please sign in to comment.