Skip to content

Commit

Permalink
Code formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
rasmusselsmark committed Sep 16, 2024
1 parent a09ff42 commit 95f3308
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions members/models/activity.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,21 @@ def clean(self):
if self.signup_closing is None:
errors["signup_closing"] = "Der skal angives en dato for tilmeldingsfrist"

if (self.start_date is not None) and (self.end_date is not None) and (self.start_date > self.end_date):
if (
(self.start_date is not None)
and (self.end_date is not None)
and (self.start_date > self.end_date)
):
errors["signup_closing"] = "Startdato skal være før aktivitetens slutdato"

if (self.signup_closing is not None) and (self.end_date is not None) and (self.signup_closing > self.end_date):
errors["signup_closing"] = "Tilmeldingsfristen skal være før aktiviteten slutter"
if (
(self.signup_closing is not None)
and (self.end_date is not None)
and (self.signup_closing > self.end_date)
):
errors["signup_closing"] = (
"Tilmeldingsfristen skal være før aktiviteten slutter"
)

if errors:
raise ValidationError(errors)

0 comments on commit 95f3308

Please sign in to comment.