Commit ad58d859 authored by Ryan Herbert's avatar Ryan Herbert
Browse files

models/tag.py extract unique tags

Previously TagExtractor.parse_text would return all matches, including
duplicates, and would therefore potentially link a tag to a set or
sample multiple times (if used mutiple times in the info field).

This commit ensures tags are extracted only once, but will not affect
the link in the frontend
parent 8a921ff3
......@@ -49,7 +49,7 @@ class TagExtractor(TagManager):
db.commit()
def parse_text(self, text):
return re.findall(self.expression(), text)
return list(set(re.findall(self.expression(), text)))
def execute(self, table, record_id, text, group_id, reset=False):
if (reset):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment