From 7258dc6eff46774037ff07b7ae06dde2db0eef5b Mon Sep 17 00:00:00 2001 From: Henrik Levkowetz Date: Sat, 7 Mar 2015 15:42:34 +0000 Subject: [PATCH] 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 --- ietf/person/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ietf/person/models.py b/ietf/person/models.py index d7e8ded25..e47276da0 100644 --- a/ietf/person/models.py +++ b/ietf/person/models.py @@ -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