Skip to content
Snippets Groups Projects
Commit e7501fc0 authored by Pavel Kácha's avatar Pavel Kácha
Browse files

Server now indexes tags (Types) of all event Nodes, not just first one

parent 1f081e41
No related branches found
No related tags found
No related merge requests found
......@@ -633,12 +633,11 @@ class MySQL(ObjectReq):
cat_id = self.catmap.get(cat, self.catmap_other)
self.query("INSERT INTO event_category_mapping (event_id,category_id) VALUES (%s, %s)", (lastid, cat_id), dml=True)
try:
tags = event['Node'][0]['Tags']
except (KeyError, IndexError):
tags = []
for tag in tags:
nodes = event.get('Node', [])
tags = []
for node in nodes:
tags.extend(node.get('Type', []))
for tag in set(tags):
tag_id = self.tagmap.get(tag, self.tagmap_other)
self.query("INSERT INTO event_tag_mapping (event_id,tag_id) VALUES (%s, %s)", (lastid, tag_id), dml=True)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment