8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-11-05 01:16:27 +00:00

Merge branch 'fix-multi-op-side-effect' into 'dev'

Fix side effect when importing multi_op

See merge request re2o/re2o!581
This commit is contained in:
chirac 2020-12-30 18:24:42 +01:00
commit 01384ce296

View file

@ -36,15 +36,17 @@ from topologie.models import Dormitory
from .preferences.models import MultiopOption
class DormitoryForm(FormRevMixin, Form):
"""Form used to select dormitories."""
dormitory = forms.ModelMultipleChoiceField(
queryset=MultiopOption.get_cached_value("enabled_dorm").all(),
label=_("Dormitory"),
widget=forms.CheckboxSelectMultiple,
required=False,
queryset=Dormitory.objects.none(),
)
def __init__(self, *args, **kwargs):
super(DormitoryForm, self).__init__(*args, **kwargs)
self.fields["dormitory"].queryset = MultiopOption.get_cached_value("enabled_dorm").all()