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

Now works with python <2.7 (without set comprehension)

parent d5679493
No related branches found
No related tags found
No related merge requests found
...@@ -538,7 +538,7 @@ class MySQL(ObjectReq): ...@@ -538,7 +538,7 @@ class MySQL(ObjectReq):
lastid = self.crs.lastrowid lastid = self.crs.lastrowid
catlist = event.get('Category', ["Other"]) catlist = event.get('Category', ["Other"])
cats = set(catlist) | {cat.split(".", 1)[0] for cat in catlist} cats = set(catlist) | set(cat.split(".", 1)[0] for cat in catlist)
for cat in cats: for cat in cats:
cat_id = self.catmap.get(cat, self.catmap_other) cat_id = self.catmap.get(cat, self.catmap_other)
self.crs.execute("INSERT INTO event_category_mapping (event_id,category_id) VALUES (%s, %s)", (lastid, cat_id)) self.crs.execute("INSERT INTO event_category_mapping (event_id,category_id) VALUES (%s, %s)", (lastid, cat_id))
......
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