Skip to content
Snippets Groups Projects
Commit 97c3f333 authored by Holger's avatar Holger
Browse files

Fix detection when a vote does not exists on HF24

parent 63a863ec
No related branches found
No related tags found
2 merge requests!5Taken current version of master branch in the https://github.com/holgern/beem,!4Original changes pushed to master at https://github.com/holgern/beem
......@@ -11,7 +11,8 @@ Changelog
* Fix compatibility issues with HF 24
* account get_follow_count, get_followers and get_following have been fixed
* improved get_discussions calls, fallback to condenser when tags api not available
* Fix detection when content does not exists
* Fix detection when content does not exists on HF24
* Fix detection when a vote does not exists on HF24
0.24.9
------
......
......@@ -102,7 +102,11 @@ class Vote(BlockchainObject):
try:
votes = self.blockchain.rpc.get_active_votes({'author': author, 'permlink': permlink}, api="tags")['votes']
except:
votes = self.blockchain.rpc.get_active_votes(author, permlink, api="database_api")
from beemapi.exceptions import InvalidParameters
try:
votes = self.blockchain.rpc.get_active_votes(author, permlink, api="database_api")
except InvalidParameters:
raise VoteDoesNotExistsException(self.identifier)
else:
votes = self.blockchain.rpc.get_active_votes(author, permlink, api="database_api")
except UnkownKey:
......@@ -378,8 +382,11 @@ class ActiveVotes(VotesObject):
# votes = authorperm["active_votes"]
if self.blockchain.rpc.get_use_appbase():
self.blockchain.rpc.set_next_node_on_empty_reply(False)
from beemapi.exceptions import InvalidParameters
try:
votes = self.blockchain.rpc.get_active_votes(authorperm["author"], authorperm["permlink"], api="condenser")
except InvalidParameters:
raise VoteDoesNotExistsException(construct_authorperm(authorperm["author"], authorperm["permlink"]))
except:
votes = self.blockchain.rpc.get_active_votes({'author': authorperm["author"],
'permlink': authorperm["permlink"]},
......@@ -391,8 +398,11 @@ class ActiveVotes(VotesObject):
[author, permlink] = resolve_authorperm(authorperm)
if self.blockchain.rpc.get_use_appbase():
self.blockchain.rpc.set_next_node_on_empty_reply(False)
from beemapi.exceptions import InvalidParameters
try:
votes = self.blockchain.rpc.get_active_votes(author, permlink, api="condenser")
except InvalidParameters:
raise VoteDoesNotExistsException(construct_authorperm(author, permlink))
except:
votes = self.blockchain.rpc.get_active_votes({'author': author,
'permlink': permlink},
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment