diff options
-rw-r--r-- | app/python/generate_cal_urls.py | 1 | ||||
-rw-r--r-- | app/python/import_cals.py | 7 |
2 files changed, 4 insertions, 4 deletions
diff --git a/app/python/generate_cal_urls.py b/app/python/generate_cal_urls.py index 4546b5c..a79f9d0 100644 --- a/app/python/generate_cal_urls.py +++ b/app/python/generate_cal_urls.py @@ -3,6 +3,7 @@ from slugify import slugify from rcal.db import Session from rcal.model import Calendar + def main(): session = Session.create() for calendar in session.query(Calendar).all(): diff --git a/app/python/import_cals.py b/app/python/import_cals.py index ae33c84..f0b5262 100644 --- a/app/python/import_cals.py +++ b/app/python/import_cals.py @@ -65,10 +65,9 @@ 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'] + if 'category_mapping' in CONFIG and \ + cal['category'] in CONFIG['category_mapping']: + cal['category'] = CONFIG['category_mapping'][cal['category']] # informational only if db_cal.category.name != cal['category']: |