Skip to content
Snippets Groups Projects
Commit d054b80b authored by Johannes Raggam's avatar Johannes Raggam
Browse files

dont err when AUTOMATION_BASE_URL isnt set

parent 995873b6
No related branches found
No related tags found
No related merge requests found
...@@ -3,7 +3,11 @@ from django.conf import settings ...@@ -3,7 +3,11 @@ from django.conf import settings
import json import json
import urllib import urllib
def get_automation_id_choices(): def get_automation_id_choices():
shows_list = json.load(urllib.urlopen(settings.AUTOMATION_BASE_URL))['shows'] base_url = getattr(settings, 'AUTOMATION_BASE_URL', None)
shows = [(s['id'], s['title']) for s in shows_list] shows = []
return shows if base_url:
\ No newline at end of file shows_list = json.load(urllib.urlopen(base_url))['shows']
shows = [(s['id'], s['title']) for s in shows_list]
return shows
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment