Ensuring calls default to the values found by the Settings object in indicoio.config

This commit is contained in:
Madison May
2015-02-27 16:33:22 -05:00
parent 110abaf7a6
commit e9fc025e95
11 changed files with 67 additions and 20 deletions
+5 -3
View File
@@ -13,16 +13,18 @@ def api_handler(arg, cloud, api, batch=False, auth=None, **kwargs):
json_data = json.dumps(data)
if cloud:
host = "%s.indico.domains"
host = "%s.indico.domains" % cloud
else:
# default to indico public cloud
host = config.public_api_host
host = config.PUBLIC_API_HOST
url = "http://%s/%s" % (host, api)
if batch:
url += "/batch"
if not auth:
auth = config.AUTH
response = requests.post(url, data=json_data, headers=JSON_HEADERS, auth=auth).json()
results = response.get('results', False)
if results is False: