Skip to content

Commit

Permalink
Merge pull request City-of-Helsinki#43 from aapris/master
Browse files Browse the repository at this point in the history
Fix matko pop/rock Keyword id issue
  • Loading branch information
juyrjola committed Jan 19, 2015
2 parents abd0636 + 96adfc0 commit 2d903a8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions events/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,7 @@ def _filter_event_queryset(queryset, params, srs=None):
# Filter only super or sub events if recurring has value
val = params.get('recurring', None)
if val:
val = val.lower()
if val == 'super':
queryset = queryset.filter(is_recurring_super=True)
elif val == 'sub':
Expand Down
10 changes: 9 additions & 1 deletion events/importer/matko.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,10 +265,18 @@ def _import_event_from_feed(self, lang_code, item, events, keyword_matcher):
event_types.update(
map(lambda x: x.lower(), t.split(",")))

# Save offers.is_free if 'ilmaistapahtumat' tag is present
if 'ilmaistapahtumat' in event_types:
if 'offers' not in event:
event['offers'] = [recur_dict()]
offer = event['offers'][0]
offer['is_free'] = True

keywords = []
for t in event_types:
# Save original keyword in the raw too
_id = 'matko:{}'.format(t)
# Note: / in keyword id breaks URL resolver so we replace it with _
_id = 'matko:{}'.format(t.replace('/', '_'))
kwargs = {
'id': _id, # id like matko:konsertti
'data_source_id': 'matko',
Expand Down

0 comments on commit 2d903a8

Please sign in to comment.