mirror of https://github.com/openspug/spug
F 修复普通用户创建应用或环境某些情况下失败的问题
parent
1a89fae8c1
commit
2f839877d1
|
@ -91,7 +91,9 @@ class Role(models.Model, ModelMixin):
|
||||||
return tmp
|
return tmp
|
||||||
|
|
||||||
def add_deploy_perm(self, target, value):
|
def add_deploy_perm(self, target, value):
|
||||||
perms = json.loads(self.deploy_perms) if self.deploy_perms else {'apps': [], 'envs': []}
|
perms = {'apps': [], 'envs': []}
|
||||||
|
if self.deploy_perms:
|
||||||
|
perms.update(json.loads(self.deploy_perms))
|
||||||
perms[target].append(value)
|
perms[target].append(value)
|
||||||
self.deploy_perms = json.dumps(perms)
|
self.deploy_perms = json.dumps(perms)
|
||||||
self.save()
|
self.save()
|
||||||
|
|
Loading…
Reference in New Issue