Skip to content

Commit 0a91286

Browse files
authored
fix: Fixed bug showing the dividends growth (#293)
In the Dividends screen, the "Dividends Cash Flow" growth graph was showing an empty value. Now shows the growth again.
1 parent ba7c3d8 commit 0a91286

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/stonks_overwatch/views/dividends.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ def get(self, request):
5252
filtered_dividends = self._filter_dividends_by_option(dividends_overview, diversification_option)
5353
dividends_diversification = self._get_diversification(filtered_dividends)
5454

55+
# Calculate growth and filter calendar for the selected year
56+
dividends_growth = self._get_dividends_growth(dividends_calendar["calendar"])
57+
5558
# Filter calendar for the selected year
5659
filtered_calendar = self._filter_calendar_by_year(dividends_calendar["calendar"], calendar_year)
5760
total_year_dividends: float = sum(month_data.get("total", 0) for month_data in filtered_calendar.values())
@@ -69,9 +72,6 @@ def get(self, request):
6972
total_year_dividends,
7073
)
7174

72-
# Calculate growth and filter calendar for the selected year
73-
dividends_growth = self._get_dividends_growth(dividends_calendar["calendar"])
74-
7575
context = {
7676
"totalNetDividends": LocalizationUtility.format_money_value(
7777
value=total_net_dividends, currency=self.base_currency

0 commit comments

Comments
 (0)