Skip to content
Snippets Groups Projects
Commit 685a9512 authored by Mariusz Trela's avatar Mariusz Trela Committed by Mariusz Trela
Browse files

A conversion a long integer into a string - fixed

parent 4f38afb3
No related branches found
No related tags found
4 merge requests!456Release candidate v1 24,!230Setup monitoring with pghero,!138Small typos fixed,!129The calls 'list_votes'/'find_votes' work
This commit is part of merge request !129. Comments created here will be created in the context of that merge request.
...@@ -172,13 +172,13 @@ def result_presentation(rows, votes_presentation): ...@@ -172,13 +172,13 @@ def result_presentation(rows, votes_presentation):
for row in rows: for row in rows:
if votes_presentation == VotesPresentation.DatabaseApi: if votes_presentation == VotesPresentation.DatabaseApi:
ret.append(dict(voter=row.voter, author=row.author, permlink=row.permlink, ret.append(dict(voter=row.voter, author=row.author, permlink=row.permlink,
weight=row.weight, rshares=row.rshares, vote_percent=row.percent, weight=number_to_json_value(row.weight), rshares=number_to_json_value(row.rshares), vote_percent=row.percent,
last_update=str(row.time), num_changes=row.num_changes)) last_update=str(row.time), num_changes=row.num_changes))
elif votes_presentation == VotesPresentation.CondenserApi: elif votes_presentation == VotesPresentation.CondenserApi:
ret.append(dict(percent=str(row.percent), reputation=rep_to_raw(row.reputation), ret.append(dict(percent=str(row.percent), reputation=rep_to_raw(row.reputation),
rshares=str(row.rshares), voter=row.voter)) rshares=number_to_json_value(row.rshares), voter=row.voter))
elif votes_presentation == VotesPresentation.BridgeApi: elif votes_presentation == VotesPresentation.BridgeApi:
ret.append(dict(rshares=str(row.rshares), voter=row.voter)) ret.append(dict(rshares=number_to_json_value(row.rshares), voter=row.voter))
else: else:
ret.append(dict(percent=row.percent, reputation=rep_to_raw(row.reputation), ret.append(dict(percent=row.percent, reputation=rep_to_raw(row.reputation),
rshares=number_to_json_value(row.rshares), time=time_string_with_t(row.time), rshares=number_to_json_value(row.rshares), time=time_string_with_t(row.time),
......
...@@ -285,7 +285,7 @@ def number_to_json_value(number): ...@@ -285,7 +285,7 @@ def number_to_json_value(number):
""" """
if number > 0xFFFFFFFF: if number > 0xFFFFFFFF:
return str(number) return str(number)
return number return int(number)
def time_string_with_t(time_iso8601): def time_string_with_t(time_iso8601):
""" Ensures that time in format ISO8601 use 'T' as a data time separator """ Ensures that time in format ISO8601 use 'T' as a data time separator
......
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