Skip to content

Do not implicitly set values in clean function #2482

@jooooosef

Description

@jooooosef
        if self.cleaned_data.get("type") in [QuestionType.TEXT, QuestionType.HEADING]:
            self.cleaned_data["allows_additional_textanswers"] = False
            self.cleaned_data["counts_for_grade"] = False

in evap/staff/forms.py
Why are we setting these values here? I would think that we should check that these are indeed set to False because the frontend should enforce that. Maybe not something for this issue, but we shouldn't just ignore it if a True value falls in here

Originally posted by @niklasmohrin in #2450 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    [C] BackendFocuses on backend implementation[P] Nice to haveLowest priority. Some people might use this feature but it won't have a big impact.[T] RefactoringExisting parts should become faster, more readable, or in any other way better.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions