From 1380f3c571179f2835dbfc57bb8fe2288ffd41f4 Mon Sep 17 00:00:00 2001 From: Tollef Fog Heen Date: Wed, 1 Aug 2012 20:32:08 +0200 Subject: [PATCH] Only display overdue warning when invoice is not paid --- invoice/views.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/invoice/views.py b/invoice/views.py index 64a0f55..c1b2d69 100644 --- a/invoice/views.py +++ b/invoice/views.py @@ -66,9 +66,10 @@ class DetailInvoice(DetailView): def get_context_data(self, *args, **kwargs): context_data = super(DetailInvoice, self).get_context_data(*args, **kwargs) - if self.object.due_days < 0: + + if self.object.due_days < 0 and self.object.status != 'P': context_data.update({'alert_error': "This invoice is overdue" }) - elif self.object.due_days < 3: + elif self.object.due_days < 3 and self.object.status != 'P': context_data.update({'alert_warning': "This invoice is soon due"}) return context_data -- 2.39.5