diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2016-01-25 19:24:08 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2016-01-25 19:24:08 +0100 |
commit | 3a92c30b359a76ac5250039af95378497f844fae (patch) | |
tree | 5f7d4e3ee38342859ec8d2e2ee45adfb4b5f09a8 /ishtar_common | |
parent | da3358446124f2f3cd217f2dd4adce7dadda4169 (diff) | |
download | Ishtar-3a92c30b359a76ac5250039af95378497f844fae.tar.bz2 Ishtar-3a92c30b359a76ac5250039af95378497f844fae.zip |
Fix unicode problem on adresses
Diffstat (limited to 'ishtar_common')
-rw-r--r-- | ishtar_common/models.py | 14 |
1 files changed, 10 insertions, 4 deletions
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 |