Skip to content

Commit

Permalink
Merge pull request #1089 from CodingPirates/953-bugaktivitet-det-må-i…
Browse files Browse the repository at this point in the history
…kke-være-muligt-at-have-tilmeldingsfrist-efter-arrangement-er-afsluttet

Check om signup_closing er efter end_date for en aktivitet
  • Loading branch information
rasmusselsmark authored Aug 31, 2024
2 parents 01ed097 + c7a05e1 commit cd45f10
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions members/models/activity.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,5 +139,10 @@ def clean(self):
f"Prisen er for lav. Denne type aktivitet skal koste mindst {min_amount} kr."
)

if 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 cd45f10

Please sign in to comment.