From 632629680373825c38d2950eb6024903d842f8ba Mon Sep 17 00:00:00 2001 From: Fabien Bourgeois Date: Thu, 4 Aug 2016 08:01:38 +0200 Subject: [PATCH] [FIX]GOLEM Activity : constraint limitation, handle cases where only start or end date are fixed --- golem_activity/models/golem_activity.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/golem_activity/models/golem_activity.py b/golem_activity/models/golem_activity.py index bafc8f1..49a9198 100644 --- a/golem_activity/models/golem_activity.py +++ b/golem_activity/models/golem_activity.py @@ -50,7 +50,7 @@ class GolemActivity(models.Model): def _check_period(self): """ Check if end date if after start date """ for a in self: - if a.date_start > a.date_end: + if a.date_start and a.date_end and a.date_start > a.date_end: raise models.ValidationError(_('Start of the period cannot be ' 'after end of the period.'))