[FIX]GOLEM Activity : constraint limitation, handle cases where only start or end date are fixed

This commit is contained in:
Fabien Bourgeois 2016-08-04 08:01:38 +02:00
parent ffe75f0430
commit 6326296803
1 changed files with 1 additions and 1 deletions

View File

@ -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.'))