From 4784f0d96b0260b3c3b258e9a52ad70fcca361ee Mon Sep 17 00:00:00 2001 From: Joe Fiorini Date: Fri, 29 May 2015 13:46:19 -0400 Subject: [PATCH] Handle `then`s that return a promise --- awx/ui/static/js/shared/lodash-as-promised.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/awx/ui/static/js/shared/lodash-as-promised.js b/awx/ui/static/js/shared/lodash-as-promised.js index ef0f77029a..7316c0e021 100644 --- a/awx/ui/static/js/shared/lodash-as-promised.js +++ b/awx/ui/static/js/shared/lodash-as-promised.js @@ -35,7 +35,13 @@ function lodashAsPromised($q) { } function _then(promise, fn) { - return promise.then(fn); + return promise.then(function(value) { + if (_.isFunction(value.then)) { + return _then(value, fn); + } else { + return fn(value); + } + }); } function _catch(promise, fn) {