Skip to content

Commit

Permalink
Fix unit tests (#11583)
Browse files Browse the repository at this point in the history
  • Loading branch information
Maffooch authored Jan 16, 2025
1 parent 49e0a5c commit 7b5ab4d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion dojo/api_v2/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1768,7 +1768,11 @@ def get_display_status(self, obj) -> str:
return obj.status()

def process_risk_acceptance(self, data):
is_risk_accepted = data.get("risk_accepted", False)
is_risk_accepted = data.get("risk_accepted")
# Do not take any action if the `risk_accepted` was not passed
if not isinstance(is_risk_accepted, bool):
return
# Determine how to proceed based on the value of `risk_accepted`
if is_risk_accepted and not self.instance.risk_accepted and self.instance.test.engagement.product.enable_simple_risk_acceptance and not data.get("active", False):
ra_helper.simple_risk_accept(self.context["request"].user, self.instance)
elif not is_risk_accepted and self.instance.risk_accepted: # turning off risk_accepted
Expand Down

0 comments on commit 7b5ab4d

Please sign in to comment.