[Update] 修改一些逻辑

This commit is contained in:
ibuler
2018-07-14 00:47:21 +08:00
parent 7412bdcba7
commit 28e47f33c1
30 changed files with 167 additions and 185 deletions

View File

@@ -220,11 +220,10 @@ class User(AbstractUser):
if self.username == 'admin':
self.role = 'Admin'
self.is_active = True
instance = super().save(*args, **kwargs)
super().save(*args, **kwargs)
current_org = get_current_org()
if current_org and current_org.is_real():
instance.orgs.add(current_org)
return instance
self.orgs.add(current_org)
@property
def private_token(self):