From 7a230071c9a703befd2838df390c90387fc0d42b Mon Sep 17 00:00:00 2001 From: Teymour Aldridge Date: Fri, 29 Nov 2024 22:59:14 +0100 Subject: [PATCH] Allow zero values for integer feedback scales. --- tabbycat/adjfeedback/admin.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tabbycat/adjfeedback/admin.py b/tabbycat/adjfeedback/admin.py index 9d22d15339a..6531eb89c42 100644 --- a/tabbycat/adjfeedback/admin.py +++ b/tabbycat/adjfeedback/admin.py @@ -40,8 +40,10 @@ 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")) + 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