allowed missing subsidy/allowance receivers in admin form and cost overview

pull/112/head
mariusrklein 11 months ago committed by marius.klein
parent b056ff8881
commit df515d7cac

@ -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()

@ -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):

Loading…
Cancel
Save