Fix exception in query history for python 2.7. Fixes #4663

This commit is contained in:
Aditya Toshniwal
2019-08-30 09:07:03 +05:30
committed by Akshay Joshi
parent e0c53e7d1d
commit 47f26cc377
2 changed files with 3 additions and 1 deletions

View File

@@ -37,4 +37,5 @@ Bug fixes
| `Issue #4644 <https://redmine.postgresql.org/issues/4644>`_ - Fix length and precision enable/disable issue when changing the data type for Domain node.
| `Issue #4650 <https://redmine.postgresql.org/issues/4650>`_ - Fix SQL tab issue for Views. It's a regression of compound triggers.
| `Issue #4657 <https://redmine.postgresql.org/issues/4657>`_ - Fix PGADMIN_SERVER_JSON_FILE environment variable support in the container.
| `Issue #4663 <https://redmine.postgresql.org/issues/4663>`_ - Fix exception in query history for python 2.7.
| `Issue #4674 <https://redmine.postgresql.org/issues/4674>`_ - Fix query tool launch error if user name contain html characters.

View File

@@ -14,11 +14,12 @@ class QueryHistory:
QueryHistoryModel.dbname == dbname) \
.all()
# In Python 2.7, rec.query_info has buffer data type. Cast it.
return make_json_response(
data={
'status': True,
'msg': '',
'result': [rec.query_info for rec in result]
'result': [bytes(rec.query_info) for rec in list(result)]
}
)