Skip to content
Snippets Groups Projects
Commit b3ea5440 authored by Marcin's avatar Marcin
Browse files

issue#37: correct pending payouts values in condenser api methods

parent e0fc0ca3
No related branches found
No related tags found
4 merge requests!456Release candidate v1 24,!230Setup monitoring with pghero,!135Enable postgres monitoring on CI server,!81Mi issue 37 wrong pending payout
...@@ -34,6 +34,7 @@ SQL_TEMPLATE = """ ...@@ -34,6 +34,7 @@ SQL_TEMPLATE = """
hp.promoted, hp.promoted,
hp.payout, hp.payout,
hp.payout_at, hp.payout_at,
hp.pending_payout,
hp.is_paidout, hp.is_paidout,
hp.children, hp.children,
hp.votes, hp.votes,
......
...@@ -181,6 +181,7 @@ def _condenser_post_object(row, truncate_body=0): ...@@ -181,6 +181,7 @@ def _condenser_post_object(row, truncate_body=0):
if not row['category']: if not row['category']:
row['category'] = 'undefined' row['category'] = 'undefined'
full_payout = row['pending_payout'] + row['payout'];
post = {} post = {}
post['post_id'] = row['id'] post['post_id'] = row['id']
post['author'] = row['author'] post['author'] = row['author']
...@@ -201,7 +202,7 @@ def _condenser_post_object(row, truncate_body=0): ...@@ -201,7 +202,7 @@ def _condenser_post_object(row, truncate_body=0):
post['cashout_time'] = json_date(None if paid else row['payout_at']) post['cashout_time'] = json_date(None if paid else row['payout_at'])
post['total_payout_value'] = _amount(row['payout'] if paid else 0) post['total_payout_value'] = _amount(row['payout'] if paid else 0)
post['curator_payout_value'] = _amount(0) post['curator_payout_value'] = _amount(0)
post['pending_payout_value'] = _amount(row['pending_payout']) post['pending_payout_value'] = _amount(0 if paid else full_payout)
post['promoted'] = _amount(row['promoted']) post['promoted'] = _amount(row['promoted'])
post['replies'] = [] post['replies'] = []
......
Subproject commit a88d42a79b9f006466d7a15650ccdc68f56004ea Subproject commit ee20b992bb7dae36ea964bde1e3b7f58b103dae6
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