feat: base get_object加锁时注意is_deleted过滤采用base_manager

This commit is contained in:
caoqianming 2025-11-25 10:46:44 +08:00
parent 3f2db2a4af
commit ae7863871a
1 changed files with 1 additions and 1 deletions

View File

@ -111,7 +111,7 @@ class CustomGenericViewSet(MyLoggingMixin, GenericViewSet):
try: try:
obj = queryset.get(**filter_kwargs) obj = queryset.get(**filter_kwargs)
l_obj = queryset.model.objects.select_for_update().get(pk=obj.pk) l_obj = queryset.model._base_manager.select_for_update().get(pk=obj.pk)
self.check_object_permissions(self.request, l_obj) self.check_object_permissions(self.request, l_obj)
return l_obj return l_obj