fix bug where JT admins could not edit spec

This commit is contained in:
AlanCoding
2017-10-18 09:52:32 -04:00
parent 6347db56c5
commit 098a407e25
4 changed files with 55 additions and 24 deletions

View File

@@ -528,6 +528,18 @@ def _request(verb):
middleware.process_response(request, response)
if expect:
if response.status_code != expect:
data_copy = response.data.copy()
try:
# Make translated strings printable
for key, value in response.data.items():
if isinstance(value, list):
response.data[key] = []
for item in value:
response.data[key].append(str(value))
else:
response.data[key] = str(value)
except Exception:
response.data = data_copy
print(response.data)
assert response.status_code == expect
response.render()