From 35f0d84609304f82fe140c40b3e12c09c166ec87 Mon Sep 17 00:00:00 2001 From: Ivan Yelizariev Date: Mon, 2 Feb 2015 12:13:08 +0200 Subject: [PATCH] [FIX] oldest lead [FIX] at mail_wall_widgets: date = date or today --- models.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/models.py b/models.py index 82b6863..1cf64c6 100644 --- a/models.py +++ b/models.py @@ -90,8 +90,11 @@ Slice - use "domain" for total and "won_domain" for target tomorrow = today + timedelta(days=1) def r2date(r): d = getattr(r, field_date_name) - d = datetime.strptime(d, self.field_date_id.ttype=='date' and DEFAULT_SERVER_DATE_FORMAT or DEFAULT_SERVER_DATETIME_FORMAT) - d = d.date() + if d: + d = datetime.strptime(d, self.field_date_id.ttype=='date' and DEFAULT_SERVER_DATE_FORMAT or DEFAULT_SERVER_DATETIME_FORMAT) + d = d.date() + else: + d = date.today() return d groups = [ {