mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-22 03:13:12 +00:00
Fix side effect when importing multi_op
This commit is contained in:
parent
2f2566ac64
commit
4ec4763d1c
1 changed files with 3 additions and 1 deletions
|
@ -36,15 +36,17 @@ from topologie.models import Dormitory
|
||||||
|
|
||||||
from .preferences.models import MultiopOption
|
from .preferences.models import MultiopOption
|
||||||
|
|
||||||
|
|
||||||
class DormitoryForm(FormRevMixin, Form):
|
class DormitoryForm(FormRevMixin, Form):
|
||||||
"""Form used to select dormitories."""
|
"""Form used to select dormitories."""
|
||||||
|
|
||||||
dormitory = forms.ModelMultipleChoiceField(
|
dormitory = forms.ModelMultipleChoiceField(
|
||||||
queryset=MultiopOption.get_cached_value("enabled_dorm").all(),
|
|
||||||
label=_("Dormitory"),
|
label=_("Dormitory"),
|
||||||
widget=forms.CheckboxSelectMultiple,
|
widget=forms.CheckboxSelectMultiple,
|
||||||
required=False,
|
required=False,
|
||||||
|
queryset=Dormitory.objects.none(),
|
||||||
)
|
)
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
super(DormitoryForm, self).__init__(*args, **kwargs)
|
super(DormitoryForm, self).__init__(*args, **kwargs)
|
||||||
|
self.fields["dormitory"].queryset = MultiopOption.get_cached_value("enabled_dorm").all()
|
||||||
|
|
Loading…
Reference in a new issue