mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-06-23 13:37:31 +00:00
fix: 修复空库 migrate 的问题
This commit is contained in:
parent
c9b8c087c7
commit
e6d845ae55
@ -60,7 +60,7 @@ class OrgModelMixin(models.Model):
|
||||
sep = '@'
|
||||
|
||||
def save(self, *args, **kwargs):
|
||||
locking_org = getattr(self, 'locking_org', None)
|
||||
locking_org = getattr(self, 'LOCKING_ORG', None)
|
||||
if locking_org:
|
||||
org = Organization.get_instance(locking_org)
|
||||
else:
|
||||
|
@ -105,12 +105,11 @@ def tmp_to_builtin_org(system=0, default=0):
|
||||
|
||||
def filter_org_queryset(queryset):
|
||||
locking_org = getattr(queryset.model, 'LOCKING_ORG', None)
|
||||
if locking_org:
|
||||
org = Organization.get_instance(locking_org)
|
||||
else:
|
||||
org = get_current_org()
|
||||
org = get_current_org()
|
||||
|
||||
if org is None:
|
||||
if locking_org:
|
||||
kwargs = {'org_id': locking_org}
|
||||
elif org is None:
|
||||
kwargs = {}
|
||||
elif org.is_root():
|
||||
kwargs = {}
|
||||
|
Loading…
Reference in New Issue
Block a user