* [Update] 添加org api, 升级到django 2.0

* [Update] fix some bug

* [Update] 修改一些bug
This commit is contained in:
老广
2018-07-24 22:21:12 -05:00
committed by GitHub
parent c816875f28
commit b156f4ad16
28 changed files with 200 additions and 87 deletions

View File

@@ -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):