Skip to content
Snippets Groups Projects
Commit fd5ecd9b authored by Holger Nahrstaedt's avatar Holger Nahrstaedt
Browse files

Fix comment

parent 52203d95
No related branches found
No related tags found
No related merge requests found
......@@ -72,7 +72,7 @@ class Comment(BlockchainObject):
self[p] = Amount(self.get(p, "0.000 SBD"), steem_instance=self.steem)
# turn json_metadata into python dict
self.__metadata_to_dict()
self._metadata_to_dict()
self["tags"] = []
self['community'] = ''
if isinstance(self['json_metadata'], dict):
......@@ -84,13 +84,13 @@ class Comment(BlockchainObject):
def _metadata_to_dict(self):
"""turn json_metadata into python dict"""
meta_str = self.get("json_metadata", "{}")
if meta_str == "{}":
self['json_metadata'] = meta_str
if isinstance(meta_str, (string_types, bytes_types, bytearray)):
try:
self['json_metadata'] = json.loads(meta_str)
except:
self['json_metadata'] = {}
else:
self['json_metadata'] = {}
def refresh(self):
if self.identifier == "":
......
......@@ -100,7 +100,7 @@ class Vote(BlockchainObject):
if x["voter"] == voter:
vote = x
if not vote:
raise VoteDoesNotExistsException
raise VoteDoesNotExistsException(self.identifier)
super(Vote, self).__init__(vote, id_item="authorpermvoter", steem_instance=self.steem)
self.identifier = construct_authorpermvoter(author, permlink, voter)
......
......@@ -56,9 +56,11 @@ class SteemNodeRPC(GrapheneRPC):
# Forward call to GrapheneWebsocketRPC and catch+evaluate errors
self.error_cnt_call = cnt
reply = super(SteemNodeRPC, self).rpcexec(payload)
if self.next_node_on_empty_reply and not bool(reply):
if self.next_node_on_empty_reply and not bool(reply) and self.n_urls > 1:
sleep_and_check_retries(self.num_retries_call, cnt, self.url, str("Empty reply"), sleep=False)
self.next()
cnt = 0
self.error_cnt_call = 0
doRetry = True
else:
self.next_node_on_empty_reply = False
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment