Fixed buggy guard code

- Legacy-Id: 16278
This commit is contained in:
Henrik Levkowetz 2019-06-17 18:22:02 +00:00
parent bc5be6b950
commit 1e76d9ce60

View file

@ -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) and not d in r.name_contains_index.all():
if re.search(r.text, doc.name) and not doc in r.name_contains_index.all():
r.name_contains_index.add(doc)
def docs_matching_community_list_rule(rule):