Skip to content

Commit

Permalink
fix account json_metadata resolver
Browse files Browse the repository at this point in the history
  • Loading branch information
avral committed Aug 17, 2018
1 parent 303cb47 commit 0c24e75
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion account/types.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit 0c24e75

Please sign in to comment.