summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Raggam <raggam-nl@adm.at>2014-02-07 13:52:03 (GMT)
committerJohannes Raggam <raggam-nl@adm.at>2014-02-07 13:52:03 (GMT)
commitd054b80bffb26106e81d606a6ffaab56dea81a47 (patch)
treee484b1128a0d5fe425ed028e9b71ac8079eab580
parent995873b6d2cf871780cb7f026cb183620f49e4cf (diff)
dont err when AUTOMATION_BASE_URL isnt set
-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