From 8efb40ed2c588d6a22074d33b5a21cbf258d9294 Mon Sep 17 00:00:00 2001 From: Drew Larson Date: Mon, 4 Jul 2016 19:22:16 -0600 Subject: [PATCH] Return values that can't be null. --- bikeshop_project/registration/models.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/bikeshop_project/registration/models.py b/bikeshop_project/registration/models.py index c1f6434..15d1e01 100644 --- a/bikeshop_project/registration/models.py +++ b/bikeshop_project/registration/models.py @@ -98,14 +98,14 @@ class Member(models.Model): def get_full_name(self): # 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) - else: - return self.email + return '{0} {1}'.format(self.first_name, self.last_name) def get_short_name(self): # 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 - return self.user.email + return self.email