- Go to http://localhost:8000/staff/questionnaire/102/edit (questionnaire with text or heading question)
- change the type of
Sonstige Kommentare zur Masterarbeit: to e.g. positive agreement
- allow additional textanswers of
Sonstige Kommentare zur Masterarbeit: (checkbox ui is enabled after 2.)
- submit questionnaire edit form
- Visit http://localhost:8000/staff/questionnaire/102/edit again
See that additional textanswers of Sonstige Kommentare zur Masterarbeit: are NOT allowed.
When constructing the form, we always disable the textanswers field if self.instance.type in [QuestionType.TEXT, QuestionType.HEADING], i.e. not the type (potentially) submitted by the user. Thus, django always removes the allows_additional_textanswers value submitted by the user, even if the question type was also changed.
Note that we cannot enable the field in the clean* functions, as this is too late. I could not find other occurrences, as only non-user-editable fields are used elsewhere to dynamically disable form fields.
Found during reimplementation of the question form in #2513.
#2482 is somewhat related.
Sonstige Kommentare zur Masterarbeit:to e.g. positive agreementSonstige Kommentare zur Masterarbeit:(checkbox ui is enabled after 2.)See that additional textanswers of
Sonstige Kommentare zur Masterarbeit:are NOT allowed.When constructing the form, we always disable the textanswers field if
self.instance.type in [QuestionType.TEXT, QuestionType.HEADING], i.e. not the type (potentially) submitted by the user. Thus, django always removes theallows_additional_textanswersvalue submitted by the user, even if the question type was also changed.Note that we cannot enable the field in the
clean*functions, as this is too late. I could not find other occurrences, as only non-user-editable fields are used elsewhere to dynamically disable form fields.Found during reimplementation of the question form in #2513.
#2482 is somewhat related.