fixed plan share space filter

This commit is contained in:
vabene1111
2021-11-05 19:42:41 +01:00
parent fb018ef9e2
commit dda2529f6f
2 changed files with 8 additions and 3 deletions

View File

@ -36,6 +36,11 @@ class DateWidget(forms.DateInput):
class UserPreferenceForm(forms.ModelForm):
prefix = 'preference'
def __init__(self, *args, **kwargs):
space = kwargs.pop('space')
super().__init__(*args, **kwargs)
self.fields['plan_share'].queryset = User.objects.filter(userpreference__space=space).all()
class Meta:
model = UserPreference
fields = (