From c5675821245e1ffecc040d155f1b99c396db97b5 Mon Sep 17 00:00:00 2001 From: Keannu Bernasol Date: Thu, 31 Oct 2024 00:44:25 +0800 Subject: [PATCH] Filter SearchResults by title only for uniqueness --- backend/search_results/tasks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/search_results/tasks.py b/backend/search_results/tasks.py index f4a2a91..3878d40 100644 --- a/backend/search_results/tasks.py +++ b/backend/search_results/tasks.py @@ -7,7 +7,7 @@ from .models import SearchResult autoretry_for=(Exception,), retry_kwargs={"max_retries": 0, "countdown": 5} ) def create_search_result(title, link): - if SearchResult.objects.filter(title=title, link=link).exists(): + if SearchResult.objects.filter(title=title).exists(): return "SearchResult entry already exists" else: SearchResult.objects.create(title=title, link=link)