filter fields available to inherit in space settings

This commit is contained in:
smilerz 2021-12-15 16:59:33 -06:00
parent a20a877dc7
commit b0705da1fe

View File

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