Made sure that Email.__unicode__() will return a string even if address is None. Fixes an exception on deleting an email address for a Person object in the admin interface.
- Legacy-Id: 9159
This commit is contained in:
parent
a4e0287b94
commit
7258dc6eff
|
@ -156,7 +156,7 @@ class Email(models.Model):
|
|||
active = models.BooleanField(default=True) # Old email addresses are *not* purged, as history
|
||||
# information points to persons through these
|
||||
def __unicode__(self):
|
||||
return self.address
|
||||
return self.address or "Email object with id: %s"%self.pk
|
||||
|
||||
def get_name(self):
|
||||
return self.person.plain_name() if self.person else self.address
|
||||
|
|
Loading…
Reference in a new issue