Browse Source

Return values that can't be null.

feature/python-error-tracking
Drew Larson 9 years ago
parent
commit
8efb40ed2c
  1. 12
      bikeshop_project/registration/models.py

12
bikeshop_project/registration/models.py

@ -98,14 +98,14 @@ class Member(models.Model):
def get_full_name(self): def get_full_name(self):
# The user is identified by their email address # The user is identified by their email address
if self.first_name and self.last_name: return '{0} {1}'.format(self.first_name, self.last_name)
return '{0} {1}'.format(self.first_name, self.last_name)
else:
return self.email
def get_short_name(self): def get_short_name(self):
# The user is identified by their email address # The user is identified by their email address
return self.user.email if self.email:
return self.email
else:
return self.last_name
def __str__(self): # __unicode__ on Python 2 def __str__(self): # __unicode__ on Python 2
return self.user.email return self.email

Loading…
Cancel
Save