From 99e0929100f828f996b9fb55f2e5bb1356119673 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Sun, 15 Sep 2013 12:13:20 +0000 Subject: [PATCH] groupssort should be None if there are no groups --- pandora/user/models.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pandora/user/models.py b/pandora/user/models.py index f695912b..c41ae159 100644 --- a/pandora/user/models.py +++ b/pandora/user/models.py @@ -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