From 752f0688e9f224525dd163f3e2f52d1bde065267 Mon Sep 17 00:00:00 2001 From: Kaung Zin Hein Date: Sat, 5 Jul 2025 17:13:34 +0700 Subject: [PATCH] fix: decode base64 string to json string --- src/app/config/base.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/config/base.py b/src/app/config/base.py index 281758fd..f9e82661 100644 --- a/src/app/config/base.py +++ b/src/app/config/base.py @@ -1,5 +1,6 @@ from __future__ import annotations +import base64 import binascii import json import os @@ -108,7 +109,7 @@ def encoder(bin_value: bytes) -> bytes: def decoder(bin_value: bytes) -> Any: # the byte is the \x01 prefix for jsonb used by PostgreSQL. # asyncpg returns it when format='binary' - return decode_json(bin_value[1:]) + return decode_json(base64.b64decode(bin_value[1:])) dbapi_connection.await_( dbapi_connection.driver_connection.set_type_codec(