File tree Expand file tree Collapse file tree 2 files changed +13
-12
lines changed
Expand file tree Collapse file tree 2 files changed +13
-12
lines changed Original file line number Diff line number Diff line change 1313
1414def resources ():
1515 resources = io .import_yaml (session .folders ['input' ])
16- resources ['events' ] = io .import_proposals (
17- resources , session .folders ['input' ])
16+ proposals = io .import_proposals (resources , session .folders ['input' ])
17+ resources ['proposals' ] = proposals
18+ resources ['events' ] = [
19+ p for p in proposals if p ['event_type' ] in resources ['event_types' ]]
1820 return resources
1921
2022
Original file line number Diff line number Diff line change @@ -34,16 +34,15 @@ def import_proposals(resources, input_folder):
3434 with Path (input_folder , 'proposals.csv' ).open ('r' ) as file :
3535 reader = csv .DictReader (file )
3636 for row in reader :
37- if row ['session_type' ] in resources ['event_types' ]:
38- event_type = row ['session_type' ]
39- proposals .append ({
40- 'title' : row ['title' ],
41- 'duration' : int (row ['duration' ]),
42- 'demand' : float (row .get ('demand' , 0 )),
43- 'person' : slugify (row ['name' ]),
44- 'tags' : [row ['tag' ]] if row ['tag' ] != '' else [],
45- 'subtitle' : row ['subtitle' ],
46- 'event_type' : event_type })
37+ event_type = row ['session_type' ]
38+ proposals .append ({
39+ 'title' : row ['title' ],
40+ 'duration' : int (row ['duration' ]),
41+ 'demand' : float (row .get ('demand' , 0 )),
42+ 'person' : slugify (row ['name' ]),
43+ 'tags' : [row ['tag' ]] if row ['tag' ] != '' else [],
44+ 'subtitle' : row ['subtitle' ],
45+ 'event_type' : event_type })
4746 logger .debug (f'\n reources:\n { pformat (proposals )} ' )
4847 return proposals
4948
You can’t perform that action at this time.
0 commit comments