Compare commits
No commits in common. "e9246cc47f00717bb58cef74970761ae0045a965" and "643c45882fe39d3bf96cbb67d5484395132ad510" have entirely different histories.
e9246cc47f
...
643c45882f
|
|
@ -20,7 +20,6 @@ from drf_yasg.utils import swagger_auto_schema
|
|||
import json
|
||||
from django.db import connection
|
||||
from django.core.exceptions import ObjectDoesNotExist
|
||||
from django.db.utils import NotSupportedError
|
||||
|
||||
class CustomGenericViewSet(MyLoggingMixin, GenericViewSet):
|
||||
"""
|
||||
|
|
@ -110,11 +109,9 @@ class CustomGenericViewSet(MyLoggingMixin, GenericViewSet):
|
|||
filter_kwargs = {self.lookup_field: self.kwargs[lookup_url_kwarg]}
|
||||
|
||||
try:
|
||||
obj = queryset.get(**filter_kwargs)
|
||||
l_obj = queryset.model.objects.select_for_update().get(pk=obj.pk)
|
||||
obj = queryset.select_for_update().get(**filter_kwargs)
|
||||
self.check_object_permissions(self.request, obj)
|
||||
return l_obj
|
||||
|
||||
return obj
|
||||
except ObjectDoesNotExist:
|
||||
raise Http404
|
||||
else:
|
||||
|
|
|
|||
Loading…
Reference in New Issue