summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2017-01-10 22:35:56 +0100
committeremkael <emkael@tlen.pl>2017-01-10 22:35:56 +0100
commit0fbfa29fc063a0ddb06eb6882c6620bd3cc116ed (patch)
tree4f2dbb2c7bacf97eafb4e1d91df4a602054dd949 /app
parent7449a8432875bf9916c3def3c25419f2e2eb99d1 (diff)
* generating URL on calendar addition
Diffstat (limited to 'app')
-rw-r--r--app/backend/import_cals.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/app/backend/import_cals.py b/app/backend/import_cals.py
index f0b5262..e4fe32e 100644
--- a/app/backend/import_cals.py
+++ b/app/backend/import_cals.py
@@ -5,6 +5,7 @@ import time
import urllib2
import urlparse
+from slugify import slugify
from sqlalchemy import inspect
from rcal.db import Session
@@ -48,6 +49,7 @@ def update_calendar(cal, session):
if inspect(db_cal).pending:
print 'Adding calendar %s (%s)' % (cal['name'], cal['uid'])
db_cal.name = cal['name']
+ db_cal.custom_url = slugify(cal['name'])
db_cal.url = cal['url']
db_cal.website = cal['website']
db_cal.category = Category.fetch(cal['category'], session)