print first name and last name if available
This commit is contained in:
parent
eef0e4e7ba
commit
496d59e9a5
1 changed files with 7 additions and 0 deletions
|
@ -18,6 +18,7 @@ import json
|
|||
from issue.templatetags.issue_tags import *
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class User(AbstractUser):
|
||||
|
||||
@property
|
||||
|
@ -25,6 +26,12 @@ class User(AbstractUser):
|
|||
query = Q(groups__in=self.groups.all()) | Q(users=self)
|
||||
return Team.objects.filter(query)
|
||||
|
||||
def __str__(self):
|
||||
if self.first_name and self.last_name:
|
||||
return self.first_name + ' ' + self.last_name
|
||||
else:
|
||||
return self.username
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class Project(models.Model):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue