mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-07-15 15:42:10 +00:00
fix: When the organization does not exist, close ticket with an error.
This commit is contained in:
parent
5e9fabff1b
commit
7d0a901522
@ -5,8 +5,8 @@ from contextlib import contextmanager
|
|||||||
from functools import wraps
|
from functools import wraps
|
||||||
from inspect import signature
|
from inspect import signature
|
||||||
|
|
||||||
from werkzeug.local import LocalProxy
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
|
from werkzeug.local import LocalProxy
|
||||||
|
|
||||||
from common.local import thread_local
|
from common.local import thread_local
|
||||||
from .models import Organization
|
from .models import Organization
|
||||||
@ -57,6 +57,8 @@ def get_org_from_request(request):
|
|||||||
def set_current_org(org):
|
def set_current_org(org):
|
||||||
if isinstance(org, (str, uuid.UUID)):
|
if isinstance(org, (str, uuid.UUID)):
|
||||||
org = Organization.get_instance(org)
|
org = Organization.get_instance(org)
|
||||||
|
if not org:
|
||||||
|
return
|
||||||
setattr(thread_local, 'current_org_id', org.id)
|
setattr(thread_local, 'current_org_id', org.id)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user