fix: 非管理员不支持物理删除
This commit is contained in:
parent
377817f04c
commit
56d9c50a39
|
@ -154,6 +154,8 @@ class BulkDestroyModelMixin(DestroyModelMixin):
|
|||
queryset = self.filter_queryset(self.get_queryset())
|
||||
ids = request.data.get('ids', None)
|
||||
soft = request.data.get('soft', True)
|
||||
if not soft and not request.user.is_superuser:
|
||||
raise ParseError('非管理员不支持物理删除')
|
||||
if ids:
|
||||
if soft is True:
|
||||
queryset.filter(id__in=ids).delete()
|
||||
|
|
Loading…
Reference in New Issue