[FIX]GOLEM Activity : constraint limitation, handle cases where only start or end date are fixed
This commit is contained in:
parent
ffe75f0430
commit
6326296803
@ -50,7 +50,7 @@ class GolemActivity(models.Model):
|
|||||||
def _check_period(self):
|
def _check_period(self):
|
||||||
""" Check if end date if after start date """
|
""" Check if end date if after start date """
|
||||||
for a in self:
|
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 '
|
raise models.ValidationError(_('Start of the period cannot be '
|
||||||
'after end of the period.'))
|
'after end of the period.'))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user