From 2d953d27d0d1aad7491485c739a9507127354af9 Mon Sep 17 00:00:00 2001 From: Markus Krogh Date: Tue, 15 Mar 2016 12:37:16 +0000 Subject: Update manager mails and ceo mail --- maconomy/models.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'maconomy/models.py') diff --git a/maconomy/models.py b/maconomy/models.py index f878172..7f4fcd4 100644 --- a/maconomy/models.py +++ b/maconomy/models.py @@ -38,5 +38,14 @@ class Timesheet: return self.approved == 1 def __str__(self): return self.__unicode__() + def status_summary(self): + status = u"[OK]" + if self.is_missing(): + status = u"[Missing]" + elif not self.is_submitted(): + status = u"[Unsubmitted]" + elif not self.is_approved(): + status = u"[Not approved]" + return u"{} {}".format(status, self.employee) def __unicode__(self): u"{} ({})".format(self.week, self.status) -- cgit v1.1