From a946801348fecfada49a5b6684682643540cec2a Mon Sep 17 00:00:00 2001 From: Mohamed-Hacene Date: Fri, 26 Apr 2024 12:19:27 +0200 Subject: [PATCH] fix: add score field in validation error to handle front error display --- backend/core/serializers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/core/serializers.py b/backend/core/serializers.py index a2bd48817..a0fdcc79d 100644 --- a/backend/core/serializers.py +++ b/backend/core/serializers.py @@ -504,7 +504,7 @@ def validate_score(self, value): if value is not None: if value < framework.min_score or value > framework.max_score: raise serializers.ValidationError( - f"Score must be between {framework.min_score} and {framework.max_score}" + {"score": f"Score must be between {framework.min_score} and {framework.max_score}"} ) return value