summaryrefslogtreecommitdiff
path: root/program/utils.py
diff options
context:
space:
mode:
authorErnesto Rico-Schmidt <e.rico.schmidt@gmail.com>2014-02-23 18:02:40 (GMT)
committerErnesto Rico-Schmidt <e.rico.schmidt@gmail.com>2014-02-23 18:02:40 (GMT)
commitf136e6bb921b424692e7f29c93cfbf804622d47f (patch)
tree6d960430fed69d777913b6278b25c86d73b88970 /program/utils.py
parent4590065b6ca9d7698c22277a4da1505486c8b637 (diff)
parent902cc6cfbef3f50268f73dc8690295bf2d556e30 (diff)
Merge branch 'master' of https://github.com/nnrcschmdt/helsinki
Diffstat (limited to 'program/utils.py')
-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