Skip to content

Commit 0f8eb73

Browse files
jerryfletcher21alicecoordinator
authored andcommitted
fix broken log when slashed_robot
`slashed_robot_log` was not expanded so it resulted in a literal `{slashed_robot.id}` ecc. and `_logs` in `api/admin.py` threw an exception here: ```python with_hyperlinks = objects_to_hyperlinks(obj.logs) try: html_logs = format_html( f'<table style="width: 100%">{with_hyperlinks}</table>' ) except Exception as e: html_logs = f"An error occurred while formatting the parsed logs as HTML. Exception {e}" ``` Also removed a trailing parenthesis.
1 parent bd8ae1f commit 0f8eb73

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

api/logics.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1806,7 +1806,7 @@ def add_slashed_rewards(cls, order, slashed_bond, staked_bond):
18061806
slashed_robot = slashed_bond.sender.robot
18071807
slashed_robot.earned_rewards += slashed_return
18081808
slashed_robot.save(update_fields=["earned_rewards"])
1809-
slashed_robot_log = "Robot({slashed_robot.id},{slashed_robot.user.username}) was returned {slashed_return} Sats)"
1809+
slashed_robot_log = f"Robot({slashed_robot.id},{slashed_robot.user.username}) was returned {slashed_return} Sats"
18101810

18111811
new_proceeds = int(slashed_satoshis * (1 - reward_fraction))
18121812
order.proceeds += new_proceeds

0 commit comments

Comments
 (0)