From d6d35ff6415f743397d04fb3d75d610d1a833dd6 Mon Sep 17 00:00:00 2001 From: Markus Krogh Date: Sat, 15 Jul 2017 00:06:53 +0200 Subject: python3 support --- maconomy/models.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'maconomy/models.py') diff --git a/maconomy/models.py b/maconomy/models.py index e9044ab..820014d 100644 --- a/maconomy/models.py +++ b/maconomy/models.py @@ -11,7 +11,11 @@ class Employee: return cls(id, name, email) def __unicode__(self): - return u"{} ({})".format(unicode(self.name,"ISO-8859-1"), self.id) + if type(self.name) is not unicode: + name = unicode(self.name,"ISO-8859-1") + else: + name = self.name + return u"{} ({})".format(name, self.id) class Timesheet: -- cgit v1.1