Skip to content

Commit

Permalink
Allow zero values for integer feedback scales.
Browse files Browse the repository at this point in the history
  • Loading branch information
teymour-aldridge committed Nov 29, 2024
1 parent 9d51b9a commit 9533f59
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tabbycat/adjfeedback/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,11 @@ class Meta:
def clean(self):
integer_scale = AdjudicatorFeedbackQuestion.ANSWER_TYPE_INTEGER_SCALE
if self.cleaned_data.get('answer_type') == integer_scale:
if not self.cleaned_data.get('min_value') or not self.cleaned_data.get('max_value'):
raise forms.ValidationError(_("Integer scales must have a minimum and maximum"))
print(str(self.cleaned_data))
if self.cleaned_data.get('min_value') is None:
raise forms.ValidationError(_("Error: min_value must be specified for an integer scale."))
if self.cleaned_data.get('max_value') is None:
raise forms.ValidationError(_("Error: max_value must be specified for an integer scale!"))
return self.cleaned_data


Expand Down

0 comments on commit 9533f59

Please sign in to comment.