[jobbrowser] Revert queries-hive `No JSON object could be decoded` commit
Commit ID reverted:
@@ -67,12 +67,18 @@ def jobs(request, interface=None):
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)
response['apps'] = jobs['apps']
response['total'] = jobs.get('total')
response['status'] = 0
+ if interface == 'queries-hive':
+ return JsonResponse(response['apps'])
+ else:
return JsonResponse(response)
@@ -82,6 +88,9 @@ 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':
@@ -96,6 +105,9 @@ def job(request, interface=None):
response['app'] = response_app
response['status'] = 0
+ if interface == 'queries-hive':
+ return JsonResponse(response['app'])
+ else:
return JsonResponse(response)
