fix: 修改LDAP配置API权限

pull/7797/head
Jiangjie.Bai 2022-03-10 19:03:20 +08:00 committed by Jiangjie.Bai
parent 9c75147179
commit fd64bd03b4
1 changed files with 4 additions and 4 deletions

View File

@ -111,10 +111,10 @@ class Organization(models.Model):
if role:
role_id = role.id
with tmp_to_org(self):
self.members.through.objects.create(
user=user, role_id=role_id,
org_id=self.id, scope='org'
)
defaults = {
'user': user, 'role_id': role_id, 'org_id': self.id, 'scope': 'org'
}
self.members.through.objects.update_or_create(**defaults, defaults=defaults)
def get_total_resources_amount(self):
from django.apps import apps