Skip to content
Snippets Groups Projects
Commit 5bb1c1b9 authored by Samuel GAIST's avatar Samuel GAIST
Browse files

[code][api] Use get_object in place of get_queryset

parent f5cf4ac7
No related branches found
No related tags found
No related merge requests found
......@@ -228,16 +228,7 @@ class RetrieveUpdateDestroyCodeView(RetrieveUpdateDestroyContributionView):
return modified, db_object
def get(self, request, *args, **kwargs):
db_objects = self.get_queryset()
if db_objects.count() == 0:
return Response(status=404)
db_object = db_objects[0]
version = int(self.kwargs.get("version", -1))
if version != -1 and db_object.version != version:
return Response(status=404)
db_object = self.get_object()
# Check that the user can access it
(has_access, open_source, accessibility) = db_object.accessibility_for(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment