Fix flatten on error message
@@ -58,7 +58,7 @@ class List(Api):
except:
res = 'Can\'t decode response value from server to json: %s' % r.content
else:
- res = flatten(res) if not is_complex and asset not in SIMPLE_ASSETS else res
+ res = flatten(res) if not is_complex and asset not in SIMPLE_ASSETS and r.status_code == 200 else res
res = json.dumps(res, indent=2)
finally:
print(res)
