summaryrefslogtreecommitdiff
path: root/program/utils.py
blob: cdc6a0930da3c2d3d6bcab7e572055a3042cbec0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
from django.conf import settings

import json
import urllib


def get_automation_id_choices():
    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