From e234b5d61114546e033aa696ca486b42ff82b09d Mon Sep 17 00:00:00 2001 From: Blake Owens Date: Mon, 13 May 2024 22:10:56 -0500 Subject: [PATCH] fix serializer old vs new comparison --- dojo/api_v2/serializers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dojo/api_v2/serializers.py b/dojo/api_v2/serializers.py index 387e3c2ea9e..2e0956c1732 100644 --- a/dojo/api_v2/serializers.py +++ b/dojo/api_v2/serializers.py @@ -2941,7 +2941,7 @@ def validate(self, data): for field in ['critical', 'enforce_critical', 'high', 'enforce_high', 'medium', 'enforce_medium', 'low', 'enforce_low']: old_days = getattr(self.instance, field, None) new_days = data.get(field, None) - if old_days and new_days and (old_days != new_days): + if old_days is not None and new_days is not None and (old_days != new_days): msg = 'Finding SLA expiration dates are currently being calculated. The SLA days for this SLA configuration cannot be changed until the calculation is complete.' raise serializers.ValidationError(msg) return data