[Update] 用户列表添加移除操作(在其他组织中) (#3513)

* [Update] 用户列表添加移除操作(在其他组织中)

* [Update] 用户列表添加移除操作(在其他组织中)2
This commit is contained in:
BaiJiangJie
2019-12-09 11:50:52 +08:00
committed by GitHub
parent c5785e17aa
commit 16864ca34e
8 changed files with 151 additions and 88 deletions

View File

@@ -67,6 +67,12 @@ class UserViewSet(CommonApiMixin, UserQuerysetMixin, BulkModelViewSet):
self.permission_classes = (IsSuperUser,)
return super().get_permissions()
def perform_destroy(self, instance):
if current_org.is_real():
instance.remove()
else:
return super().perform_destroy(instance)
def perform_bulk_destroy(self, objects):
for obj in objects:
self.check_object_permissions(self.request, obj)