From b0705da1fe333cc18f4329cc61a6fd6d54721760 Mon Sep 17 00:00:00 2001 From: smilerz Date: Wed, 15 Dec 2021 16:59:33 -0600 Subject: [PATCH] filter fields available to inherit in space settings --- cookbook/forms.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cookbook/forms.py b/cookbook/forms.py index b0cd39ff..364641c7 100644 --- a/cookbook/forms.py +++ b/cookbook/forms.py @@ -523,6 +523,10 @@ class SpacePreferenceForm(forms.ModelForm): reset_food_inherit = forms.BooleanField(label=_("Reset Food Inheritance"), initial=False, required=False, help_text=_("Reset all food to inherit the fields configured.")) + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) # populates the post + self.fields['food_inherit'].queryset = Food.inherit_fields + class Meta: model = Space