mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-09-10 03:39:59 +00:00
Tmp org (#1579)
* [Update] 添加org api, 升级到django 2.0 * [Update] fix some bug * [Update] 修改一些bug
This commit is contained in:
@@ -195,7 +195,7 @@ class User(AbstractUser):
|
||||
|
||||
@property
|
||||
def is_org_admin(self):
|
||||
if self.is_superuser or self.admin_orgs:
|
||||
if self.is_superuser or self.admin_orgs.exists():
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
@@ -223,7 +223,7 @@ class User(AbstractUser):
|
||||
self.is_active = True
|
||||
super().save(*args, **kwargs)
|
||||
if current_org and current_org.is_real():
|
||||
self.orgs.add(current_org)
|
||||
self.orgs.add(current_org.id)
|
||||
|
||||
@property
|
||||
def private_token(self):
|
||||
|
Reference in New Issue
Block a user