summaryrefslogtreecommitdiff
path: root/program
diff options
context:
space:
mode:
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