From 814ac8fe247a39e8235a21aae8bedd81ad57e553 Mon Sep 17 00:00:00 2001 From: Henrik Levkowetz Date: Mon, 17 Jun 2019 17:46:55 +0000 Subject: [PATCH] Added a guard against duplicate insertions in SearchRule.name_contains_index - Legacy-Id: 16276 --- ietf/community/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ietf/community/utils.py b/ietf/community/utils.py index 7e5b7b558..de322bf7c 100644 --- a/ietf/community/utils.py +++ b/ietf/community/utils.py @@ -81,7 +81,7 @@ def update_name_contains_indexes_with_new_doc(doc): # Django doesn't support a reversed regex operator, and regexp # support needs backend-specific code so custom SQL is a bit # cumbersome too - if re.search(r.text, doc.name): + if re.search(r.text, doc.name) and not d in r.name_contains_index.all(): r.name_contains_index.add(doc) def docs_matching_community_list_rule(rule):