From 0c24e7521fdee2f5b8182829e121e17c68040a75 Mon Sep 17 00:00:00 2001 From: avral Date: Fri, 17 Aug 2018 12:17:52 +0300 Subject: [PATCH] fix account json_metadata resolver --- account/types.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/account/types.py b/account/types.py index 9af3b37..b990978 100644 --- a/account/types.py +++ b/account/types.py @@ -1,5 +1,6 @@ from contextlib import suppress +from mongoengine.base.datastructures import BaseDict import graphene from graphene.relay import Node from graphene_mongo import MongoengineObjectType @@ -45,7 +46,10 @@ class Meta: interfaces = (Node,) def resolve_meta(self, info): - return self.json_metadata or {} + if isinstance(self.json_metadata, BaseDict): + return self.json_metadata + else: + return {} class AccountAuthority(MongoengineObjectType):