refactor: remove duplicate calculation

This commit is contained in:
Herculino Trotta
2024-12-13 23:27:54 -03:00
parent 93b483ec76
commit 0b60f73e44

View File

@@ -140,19 +140,6 @@ def strategy_detail(request, strategy_id):
]
entries_data.reverse()
# Prepare entries data with current values
# Prepare entries data with current values
entries_data = [
{
"entry": entry,
"current_value": entry.current_value(),
"profit_loss": entry.profit_loss(),
"profit_loss_percentage": entry.profit_loss_percentage(),
}
for entry in entries
]
entries_data.reverse()
context = {
"strategy": strategy,
"entries": entries,