Commit 30e712c1 by Őry Máté

school: hotfix http500 on group with never-logged-in owner

parent 8c2ea6bf
...@@ -36,10 +36,13 @@ class Person(models.Model): ...@@ -36,10 +36,13 @@ class Person(models.Model):
return one.models.Share.objects.filter(group__in=self.course_groups.all()) return one.models.Share.objects.filter(group__in=self.course_groups.all())
def short_name(self): def short_name(self):
if self.user.last_name: if self.user:
return self.user.last_name if self.user.last_name:
return self.user.last_name
else:
return self.user.username
else: else:
return self.user.username return self.code
def __unicode__(self): def __unicode__(self):
u = self.user u = self.user
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment