AUTHOR_OPTION_ALL = 0
AUTHOR_OPTION_CUSTOMIZED = 1
AUTHOR_SCOPE_CHOICES = (
(AUTHOR_OPTION_ALL, 'All students in the course'),
(AUTHOR_OPTION_CUSTOMIZED, 'Specify a student'),
)
Choices like AUTHOR_OPTION_ALL defined as numbers cause extra conversion in parsing them.
if int(self.cleaned_data['submission_scope']) == RegradeForm.SUBMISSION_OPTION_CUSTOMIZED:
Proposed solution: define them as string directly.
Choices like
AUTHOR_OPTION_ALL
defined as numbers cause extra conversion in parsing them.Proposed solution: define them as string directly.