diff --git a/jdav_web/finance/models.py b/jdav_web/finance/models.py index de10941..3201440 100644 --- a/jdav_web/finance/models.py +++ b/jdav_web/finance/models.py @@ -164,7 +164,8 @@ class Statement(CommonModel): @property def allowance_to_valid(self): """Checks if the configured `allowance_to` field matches the regulations.""" - if self.allowance_to.count() != self.real_staff_count: + if self.allowance_to.count() > self.real_staff_count: + # it is allows that less allowances are utilized than youth leaders are enlisted return False if self.excursion is not None: yls = self.excursion.jugendleiter.all() diff --git a/jdav_web/members/admin.py b/jdav_web/members/admin.py index 6bd9cbe..9a46ce6 100644 --- a/jdav_web/members/admin.py +++ b/jdav_web/members/admin.py @@ -866,11 +866,6 @@ class StatementOnListForm(forms.ModelForm): 'allowance_to': _("This excursion only has up to %(approved_count)s approved youth leaders, but you listed %(entered_count)s.") % {'approved_count': str(excursion.approved_staff_count), 'entered_count': str(allowance_to.count())}, }) - if allowance_to.count() < min(excursion.approved_staff_count, excursion.jugendleiter.count()): - raise ValidationError({ - 'allowance_to': _("This excursion has %(approved_count)s approved youth leaders, but you listed only %(entered_count)s.") % {'approved_count': str(excursion.approved_staff_count), - 'entered_count': str(allowance_to.count())}, - }) class StatementOnListInline(CommonAdminInlineMixin, nested_admin.NestedStackedInline):