Skip to content

Commit

Permalink
Fix Error Causing Voting to Fail
Browse files Browse the repository at this point in the history
Voting using `.vote()` checks if the post is archived, and if it is, it raises the `VotingInvalidOnArchivedPost` error.

However, prior to this fix, it checked if the `net_rshares` of the post was 0, which would also fire if the post did not have any votes on it yet. This fix allows posts that aren't archived but have 0 votes to be voted on.
  • Loading branch information
aditya-ramabadran committed Oct 18, 2017
1 parent 33dc65c commit 9bc2f58
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion steem/post.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ def vote(self, weight, voter=None):
"""
# Test if post is archived, if so, voting is worthless but just
# pollutes the blockchain and account history
if not self.get('net_rshares'):
if self.get('net_rshares', None) == None:
raise VotingInvalidOnArchivedPost
return self.commit.vote(self.identifier, weight, account=voter)

Expand Down

0 comments on commit 9bc2f58

Please sign in to comment.