From 3a92c30b359a76ac5250039af95378497f844fae Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Mon, 25 Jan 2016 19:24:08 +0100 Subject: Fix unicode problem on adresses --- ishtar_common/models.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'ishtar_common') diff --git a/ishtar_common/models.py b/ishtar_common/models.py index 385cf8f68..7491f5704 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -1090,16 +1090,22 @@ class Address(BaseHistorizedItem): if self.postal_code or self.town: if lbl: lbl += "\n" - lbl += "{}{}{}".format( + lbl += u"{}{}{}".format( self.postal_code or '', " " if self.postal_code and self.town else '', self.town or '') if self.phone: - lbl += "{}{}".format(unicode(_("Tel:")), self.phone) + if lbl: + lbl += u"\n" + lbl += u"{}{}".format(unicode(_("Tel: ")), self.phone) if self.mobile_phone: - lbl += "{}{}".format(unicode(_("Mobile: ")), self.mobile_phone) + if lbl: + lbl += u"\n" + lbl += u"{}{}".format(unicode(_("Mobile: ")), self.mobile_phone) if self.email: - lbl += "{}{}".format(unicode(_("Email: ")), self.email) + if lbl: + lbl += u"\n" + lbl += u"{}{}".format(unicode(_("Email: ")), self.email) return lbl -- cgit v1.2.3