From c5dd66013fa2346fa3600e8c1205426fd289fd11 Mon Sep 17 00:00:00 2001 From: Tasos Katsoulas Date: Mon, 9 Dec 2024 12:27:49 +0200 Subject: [PATCH] Remove reference to old FK --- kitsune/products/models.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/kitsune/products/models.py b/kitsune/products/models.py index 7118636cc6b..3124bc58e85 100644 --- a/kitsune/products/models.py +++ b/kitsune/products/models.py @@ -189,12 +189,10 @@ class Meta(object): def save(self, *args, **kwargs): # Mark the old topics as archived - try: - old_topic = Topic.active.get(slug=self.slug, product=self.topic.product) + old_topics = Topic.active.filter(slug=self.slug) + for old_topic in old_topics: old_topic.is_archived = True old_topic.save() - except Topic.DoesNotExist: - ... super().save(*args, **kwargs)