mirror of https://github.com/jumpserver/jumpserver
fix: 修改默认组织 builtin 字段处理问题
parent
5d37d1b7b1
commit
e4d372be32
|
@ -140,7 +140,10 @@ class Organization(OrgRoleMixin, models.Model):
|
||||||
@classmethod
|
@classmethod
|
||||||
def default(cls):
|
def default(cls):
|
||||||
defaults = dict(id=cls.DEFAULT_ID, name=cls.DEFAULT_NAME)
|
defaults = dict(id=cls.DEFAULT_ID, name=cls.DEFAULT_NAME)
|
||||||
obj, created = cls.objects.get_or_create(defaults=defaults, id=cls.DEFAULT_ID, builtin=True)
|
obj, created = cls.objects.get_or_create(defaults=defaults, id=cls.DEFAULT_ID)
|
||||||
|
if not obj.builtin:
|
||||||
|
obj.builtin = True
|
||||||
|
obj.save()
|
||||||
return obj
|
return obj
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|
Loading…
Reference in New Issue