fix(users): 修复用户在不同组织引起的问题

This commit is contained in:
ibuler
2020-09-01 16:41:39 +08:00
committed by xinwen
parent 8227f44058
commit ddb71c43c4
3 changed files with 1 additions and 12 deletions

View File

@@ -560,12 +560,6 @@ class User(AuthMixin, TokenMixin, RoleMixin, MFAMixin, AbstractUser):
@property
def groups_display(self):
if hasattr(self, 'gc_groups__name'):
names = self.gc_groups__name
if isinstance(names, str):
return ' '.join(set(self.gc_groups__name.split(',')))
else:
return ''
return ' '.join([group.name for group in self.groups.all()])
@property