From 7c58923a84f148dd356fda008673eb19d85b7ba3 Mon Sep 17 00:00:00 2001 From: Marliana Lara Date: Thu, 20 Jul 2017 13:29:43 -0400 Subject: [PATCH] Handle typeof job query response error --- awx/ui/client/src/shared/smart-search/queryset.service.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/awx/ui/client/src/shared/smart-search/queryset.service.js b/awx/ui/client/src/shared/smart-search/queryset.service.js index 1855ed6b71..8dceeb399a 100644 --- a/awx/ui/client/src/shared/smart-search/queryset.service.js +++ b/awx/ui/client/src/shared/smart-search/queryset.service.js @@ -254,7 +254,8 @@ export default ['$q', 'Rest', 'ProcessErrors', '$rootScope', 'Wait', 'DjangoSear }, error(data, status) { if(data && data.detail){ - let error = JSON.parse(data.detail); + let error = typeof data.detail === "string" ? data.detail : JSON.parse(data.detail); + if(_.isArray(error)){ data.detail = error[0]; }