Merge pull request #10036 from jumpserver/pr@dev@perf_device_add_sudo

perf: 优化一下
pull/10038/head^2
老广 2 years ago committed by GitHub
commit 402c68edd0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -16,9 +16,7 @@ class DeviceTypes(BaseType):
'charset_enabled': False, 'charset_enabled': False,
'domain_enabled': True, 'domain_enabled': True,
'su_enabled': True, 'su_enabled': True,
'su_methods': [ 'su_methods': ['enable']
{'name': 'enable', 'id': 'enable'},
]
} }
} }

@ -19,10 +19,7 @@ class HostTypes(BaseType):
'charset': 'utf-8', # default 'charset': 'utf-8', # default
'domain_enabled': True, 'domain_enabled': True,
'su_enabled': True, 'su_enabled': True,
'su_methods': [ 'su_methods': ['sudo', 'su'],
{'name': 'sudo su -', 'id': 'sudo'},
{'name': 'su -', 'id': 'su'}
],
}, },
cls.WINDOWS: { cls.WINDOWS: {
'su_enabled': False, 'su_enabled': False,

@ -14,6 +14,8 @@ def migrate_platform_protocol_primary(apps, schema_editor):
for platform in platforms: for platform in platforms:
p = platform.protocols.first() p = platform.protocols.first()
if not p:
continue
p.primary = True p.primary = True
p.save() p.save()

Loading…
Cancel
Save