mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-10-22 16:31:33 +00:00
[Bugfix] 修复校验失败api
This commit is contained in:
@@ -10,7 +10,7 @@ from django.forms import ModelForm
|
||||
from django.http.response import HttpResponseForbidden
|
||||
|
||||
from common.utils import get_logger
|
||||
from .utils import current_org, set_current_org
|
||||
from .utils import current_org, set_current_org, set_to_root_org
|
||||
from .models import Organization
|
||||
|
||||
logger = get_logger(__file__)
|
||||
@@ -85,6 +85,12 @@ class OrgViewGenericMixin:
|
||||
return super().dispatch(request, *args, **kwargs)
|
||||
|
||||
|
||||
class RootOrgViewMixin:
|
||||
def dispatch(self, request, *args, **kwargs):
|
||||
set_to_root_org()
|
||||
return super().dispatch(request, *args, **kwargs)
|
||||
|
||||
|
||||
class OrgModelForm(ModelForm):
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
|
Reference in New Issue
Block a user