diff options
author | Markus Krogh <markus@nordu.net> | 2017-07-15 00:06:53 +0200 |
---|---|---|
committer | Markus Krogh <markus@nordu.net> | 2017-07-15 00:06:53 +0200 |
commit | d6d35ff6415f743397d04fb3d75d610d1a833dd6 (patch) | |
tree | 649449e753e5af6b81e5215cbb1e416cf816f450 /maconomy/models.py | |
parent | 3062d98f2c0db4d37953fdacc3f68f51572958b0 (diff) |
python3 support
Diffstat (limited to 'maconomy/models.py')
-rw-r--r-- | maconomy/models.py | 6 |
1 files changed, 5 insertions, 1 deletions
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: |