Allow not to ask for invoice addresses on free orders

This commit is contained in:
Raphael Michel
2019-04-04 09:48:59 +02:00
parent b931d27486
commit 243e4ac4c8
15 changed files with 125 additions and 30 deletions

View File

@@ -43,6 +43,7 @@ class QuestionForm(I18nModelForm):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.fields['items'].queryset = self.instance.event.items.all()
self.fields['items'].required = True
self.fields['dependency_question'].queryset = self.instance.event.questions.filter(
type__in=(Question.TYPE_BOOLEAN, Question.TYPE_CHOICE, Question.TYPE_CHOICE_MULTIPLE)
)