revert: 还原api限制

pull/5791/head
ibuler 2021-03-18 10:10:05 +08:00 committed by Jiangjie.Bai
parent e2406955bc
commit 8a2eb70ad2
1 changed files with 1 additions and 11 deletions

View File

@ -43,17 +43,7 @@ class OrgQuerySetMixin:
class OrgViewSetMixin(OrgQuerySetMixin):
root_org_readonly_msg = _("Root organization only allow view and delete")
def update(self, request, *args, **kwargs):
if current_org.is_root():
raise MethodNotAllowed('put', self.root_org_readonly_msg)
return super().update(request, *args, **kwargs)
def create(self, request, *args, **kwargs):
if current_org.is_root():
raise MethodNotAllowed('post', self.root_org_readonly_msg)
return super().update(request, *args, **kwargs)
pass
class OrgModelViewSet(CommonApiMixin, OrgViewSetMixin, ModelViewSet):