Skip to content

Commit

Permalink
fix serializer old vs new comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
blakeaowens committed May 14, 2024
1 parent 35aaf31 commit e234b5d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dojo/api_v2/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e234b5d

Please sign in to comment.