Ensure that date_end ≥ date_start in activities
This commit is contained in:
parent
6217f35f67
commit
7c291b115a
4 changed files with 230 additions and 196 deletions
|
|
@ -123,6 +123,9 @@ class Activity(models.Model):
|
|||
"""
|
||||
Update the activity wiki page each time the activity is updated (validation, change description, ...)
|
||||
"""
|
||||
if self.date_end < self.date_start:
|
||||
raise ValidationError(_("The end date must be after the start date."))
|
||||
|
||||
ret = super().save(*args, **kwargs)
|
||||
if settings.DEBUG and self.pk and "scripts" in settings.INSTALLED_APPS:
|
||||
def refresh_activities():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue