]> git.parisson.com Git - telemeta.git/commitdiff
fix get object for resource
authorGuillaume Pellerin <yomguy@parisson.com>
Mon, 25 May 2015 21:02:12 +0000 (23:02 +0200)
committerGuillaume Pellerin <yomguy@parisson.com>
Mon, 25 May 2015 21:02:12 +0000 (23:02 +0200)
telemeta/views/resource.py

index 5e7c483659f15c5c788faea354652f5f827fa029..11ac4415247a835497097a81278ee5dda46f7bc7 100644 (file)
@@ -230,15 +230,6 @@ class ResourceSingleMixin(ResourceMixin):
         self.setup(self.type)
         return self
 
-    def get_object(self):
-        self.type = self.kwargs['type']
-        self.setup(self.type)
-        obj = self.model.objects.filter(code=self.kwargs['public_id'])
-        if not obj:
-            return get_object_or_404(self.model, id=self.kwargs['public_id'])
-        else:
-            return obj[0]
-
     def get_context_data(self, **kwargs):
         context = super(ResourceMixin, self).get_context_data(**kwargs)
         resource = self.get_object()