Skip to content

Commit 3f755fc

Browse files
committed
Check more nodes in Helmet importer to find event location
1 parent b67cc93 commit 3f755fc

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

events/importer/helmet.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,7 @@ def set_attr(field_name, val):
300300
# Save original keyword in the raw too
301301
node_id = classification['NodeId']
302302
name = classification['NodeName']
303+
node_type = classification['Type']
303304
# Tapahtumat exists tens of times, use pseudo id
304305
if name in ('Tapahtumat', 'Events', 'Evenemang'):
305306
node_id = 1 # pseudo id
@@ -331,10 +332,9 @@ def set_attr(field_name, val):
331332
event_keywords.add(keyword_orig)
332333
### Saving original keyword ends ###
333334

334-
# Oddly enough, "Tapahtumat" node includes NodeId pointing to
335-
# HelMet location, which is mapped to Linked Events keyword ID
336-
if classification['NodeName'] in (
337-
'Tapahtumat', 'Events', 'Evenemang'):
335+
# One of the type 7 nodes (either Tapahtumat, or just the library name)
336+
# points to the location, which is mapped to Linked Events keyword ID
337+
if node_type == 7:
338338
if not 'location' in event:
339339
location_id = to_le_id(classification['NodeId'])
340340
if location_id:

0 commit comments

Comments
 (0)