[jobbrowser] Fix `No JSON object could be decoded` error for queries-hive
Removed if checks for extracting params form request body only for queries-hive calls
Related JIRAs when the checks were added:
@@ -66,8 +66,6 @@ def jobs(request, interface=None):
filters = dict([(key, value) for _filter in json.loads(
request.POST.get('filters', '[]')) for key, value in list(_filter.items()) if value
])
- if interface == 'queries-hive':
- filters = json.loads(request.body)
jobs = get_api(request.user, interface, cluster=cluster).apps(filters)
@@ -75,9 +73,6 @@ def jobs(request, interface=None):
response['total'] = jobs.get('total')
response['status'] = 0
- if interface == 'queries-hive':
- return JsonResponse(response['apps'])
- else:
return JsonResponse(response)
@@ -87,9 +82,6 @@ def job(request, interface=None):
cluster = json.loads(request.POST.get('cluster', '{}'))
interface = interface or json.loads(request.POST.get('interface'))
- if interface == 'queries-hive':
- app_id = json.loads(request.body)['queryId']
- else:
app_id = json.loads(request.POST.get('app_id'))
if interface == 'schedules':
@@ -104,9 +96,6 @@ def job(request, interface=None):
response['app'] = response_app
response['status'] = 0
- if interface == 'queries-hive':
- return JsonResponse(response['app'])
- else:
return JsonResponse(response)
