From bc1e5d69f62c4a1d29ae6ac28a1d7dcb4b9f1a87 Mon Sep 17 00:00:00 2001 From: emkael Date: Mon, 9 May 2016 12:38:26 +0200 Subject: * calendar category correction mapping for import script --- app/python/import_cals.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'app/python') diff --git a/app/python/import_cals.py b/app/python/import_cals.py index a08bfb2..f9e7fbd 100644 --- a/app/python/import_cals.py +++ b/app/python/import_cals.py @@ -65,10 +65,15 @@ def update_calendar(cal, session): db_cal.website, cal['website'], db_cal.uid) db_cal.website = cal['website'] + cal['category'] = CONFIG['category_mapping'][cal['category']] \ + if ('category_mapping' in CONFIG \ + and cal['category'] in CONFIG['category_mapping']) \ + else cal['category'] + # informational only if db_cal.category.name != cal['category']: - print 'Calendar category changed: %s -> %s (%s)' % ( - db_cal.category.name, cal['category'], db_cal.uid) + print 'Calendar category changed: %s -> %s (%s, %s)' % ( + db_cal.category.name, cal['category'], db_cal.name, db_cal.uid) def get_imported_calendars(cells, ical_markdown): -- cgit v1.2.3