Node asset amount (#2192)

* [Bugfix] 修复错误

* [Update] 优化用户api
This commit is contained in:
老广
2018-12-17 20:09:25 +08:00
committed by GitHub
parent 517a27ea33
commit b56d73ba9e
7 changed files with 84 additions and 75 deletions

View File

@@ -142,6 +142,18 @@ class User(AbstractUser):
return True
return False
@property
def groups_display(self):
return ' '.join(self.groups.all().values_list('name', flat=True))
@property
def role_display(self):
return self.get_role_display()
@property
def source_display(self):
return self.get_source_display()
@property
def is_expired(self):
if self.date_expired and self.date_expired < timezone.now():