From 4ec4763d1c9ba78a74f610f7bc39ecc21afb793c Mon Sep 17 00:00:00 2001 From: Hugo Levy-Falk Date: Wed, 30 Dec 2020 18:23:55 +0100 Subject: [PATCH] Fix side effect when importing multi_op --- multi_op/forms.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/multi_op/forms.py b/multi_op/forms.py index 59043287..f4c839de 100644 --- a/multi_op/forms.py +++ b/multi_op/forms.py @@ -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()