groupssort should be None if there are no groups
This commit is contained in:
parent
14674f07a6
commit
99e0929100
1 changed files with 4 additions and 1 deletions
|
@ -88,7 +88,10 @@ class SessionData(models.Model):
|
|||
self.username = self.user.username
|
||||
self.level = self.user.get_profile().level
|
||||
self.firstseen = self.user.date_joined
|
||||
self.groupssort = ''.join([g.name for g in self.user.groups.all()])
|
||||
if self.user.groups.exists():
|
||||
self.groupssort = ''.join([g.name for g in self.user.groups.all()])
|
||||
else:
|
||||
self.groupssort = None
|
||||
self.numberoflists = self.user.lists.count()
|
||||
else:
|
||||
self.groupssort = None
|
||||
|
|
Loading…
Reference in a new issue