From d054b80bffb26106e81d606a6ffaab56dea81a47 Mon Sep 17 00:00:00 2001 From: Johannes Raggam Date: Fri, 7 Feb 2014 14:52:03 +0100 Subject: dont err when AUTOMATION_BASE_URL isnt set 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 -- cgit v0.10.2