diff options
Diffstat (limited to 'maconomy')
-rw-r--r-- | maconomy/cli.py | 4 | ||||
-rw-r--r-- | maconomy/models.py | 6 |
2 files changed, 8 insertions, 2 deletions
diff --git a/maconomy/cli.py b/maconomy/cli.py index 426e826..69cc174 100644 --- a/maconomy/cli.py +++ b/maconomy/cli.py @@ -1,5 +1,6 @@ import argparse -from ConfigParser import SafeConfigParser +from configparser import SafeConfigParser + def parse(): parser = argparse.ArgumentParser(description="Notifies people of missing hours registration") @@ -10,6 +11,7 @@ def parse(): parser.add_argument("--summary", action="store_true", default=False, help="Prints unsubmitted, missing and non approved status") return parser.parse_args() + def load_config(conf_file): config = SafeConfigParser() config.read(conf_file) 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: |