Changeset 12271


Ignore:
Timestamp:
20 Dec 2014, 17:31:16 (10 years ago)
Author:
Henrik Bettermann
Message:

Fix fullname property.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.ikoba/trunk/src/waeup/ikoba/customers/customer.py

    r12097 r12271  
    110110    @property
    111111    def fullname(self):
     112        firstname = getattr(self, 'firstname', None)
    112113        middlename = getattr(self, 'middlename', None)
    113         if middlename:
    114             return '%s-%s-%s' % (self.firstname.lower(),
    115                 middlename.lower(), self.lastname.lower())
    116         else:
    117             return '%s-%s' % (self.firstname.lower(), self.lastname.lower())
     114        lastname = getattr(self, 'lastname', None)
     115        if middlename and lastname and firstname:
     116            return '%s-%s-%s' % (firstname.lower(),
     117                middlename.lower(), lastname.lower())
     118        elif lastname and firstname:
     119            return '%s-%s' % (firstname.lower(), lastname.lower())
     120        return None
    118121
    119122    @property
Note: See TracChangeset for help on using the changeset viewer.