summaryrefslogtreecommitdiff
path: root/program
diff options
context:
space:
mode:
authorErnesto Rico-Schmidt <e.rico.schmidt@gmail.com>2014-02-28 16:53:28 (GMT)
committerErnesto Rico-Schmidt <e.rico.schmidt@gmail.com>2014-02-28 16:53:28 (GMT)
commitf44cf6587f67095f777c4847e5cc12c5fbef957e (patch)
treeee749d125b784a0aad3647273ced6c6dfdb72ae6 /program
parentff12c7bebb0eca7495951b25d29949662bf32f9f (diff)
parent14fc181b93edac9db5435f3110feb4a8267e38d4 (diff)
Merge branch 'master' of https://github.com/nnrcschmdt/helsinki
Diffstat (limited to 'program')
-rw-r--r--program/utils.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/program/utils.py b/program/utils.py
index 5798c11..cdc6a09 100644
--- a/program/utils.py
+++ b/program/utils.py
@@ -3,7 +3,11 @@ from django.conf import settings
import json
import urllib
+
def get_automation_id_choices():
- shows_list = json.load(urllib.urlopen(settings.AUTOMATION_BASE_URL))['shows']
- shows = [(s['id'], s['title']) for s in shows_list]
- return shows \ No newline at end of file
+ base_url = getattr(settings, 'AUTOMATION_BASE_URL', None)
+ shows = []
+ if base_url:
+ shows_list = json.load(urllib.urlopen(base_url))['shows']
+ shows = [(s['id'], s['title']) for s in shows_list]
+ return shows