From 7586b510feac154d170c048135e2d39367157b1a Mon Sep 17 00:00:00 2001 From: Ties Dirksen Date: Wed, 13 Nov 2024 21:42:22 +0100 Subject: [PATCH] Fix benefactorers can have membership until end of study --- website/members/models/membership.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/website/members/models/membership.py b/website/members/models/membership.py index 1caf14dc1..3b8f178ad 100644 --- a/website/members/models/membership.py +++ b/website/members/models/membership.py @@ -6,7 +6,6 @@ from django.utils import timezone from django.utils.translation import gettext_lazy as _ from django.utils.translation import pgettext_lazy - from utils.snippets import overlaps @@ -82,6 +81,11 @@ def clean(self): if self.type != self.HONORARY and self.until is None: errors.update({"until": "A non-honorary membership must have an end date."}) + if self.type == self.BENEFACTOR and self.study_long: + errors.update( + {"study_long": "Benefactors cannot have a study long membership."} + ) + if errors: raise ValidationError(errors)