From f4c8e7ed9dd27c833dad59bd1953e18f3776e958 Mon Sep 17 00:00:00 2001 From: Andrew Williamson Date: Tue, 21 Jan 2025 23:07:21 +0000 Subject: [PATCH] fix edge case of ContentAction being called with unsaved ContentDecision --- src/olympia/abuse/actions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/olympia/abuse/actions.py b/src/olympia/abuse/actions.py index bf7be661e16f..c7cf4fd20347 100644 --- a/src/olympia/abuse/actions.py +++ b/src/olympia/abuse/actions.py @@ -41,7 +41,7 @@ def __init__(self, decision): if isinstance(self.target, Addon): self.addon_version = ( - self.decision.target_versions.order_by('-id').first() + (self.decision.id and self.decision.target_versions.order_by('-id').first()) or self.target.current_version or self.target.find_latest_version(channel=None, exclude=()) )