Skip to content

Commit 7123ab8

Browse files
committed
wip
1 parent ead4c59 commit 7123ab8

1 file changed

Lines changed: 17 additions & 17 deletions

File tree

backend/donations/views/dashboard/admin_dashboard.py

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -60,43 +60,43 @@ def _get_header_stats(today) -> List[List[Dict[str, Union[str, int | datetime]]]
6060
{
6161
"title": _("Donations this year"),
6262
"icon": "edit_document",
63-
"metric": current_year_redirections["metric"],
63+
"metric": current_year_redirections()["metric"],
6464
"footer": _create_stat_link(
65-
url=f'{reverse("admin:donations_donor_changelist")}?{current_year_range}', text=_("View all")
65+
url=f"{reverse('admin:donations_donor_changelist')}?{current_year_range}", text=_("View all")
6666
),
67-
"timestamp": current_year_redirections["timestamp"],
67+
"timestamp": current_year_redirections()["timestamp"],
6868
},
6969
{
7070
"title": _("Donations all-time"),
7171
"icon": "edit_document",
72-
"metric": all_redirections["metric"],
72+
"metric": all_redirections()["metric"],
7373
"footer": _create_stat_link(url=reverse("admin:donations_donor_changelist"), text=_("View all")),
74-
"timestamp": all_redirections["timestamp"],
74+
"timestamp": all_redirections()["timestamp"],
7575
},
7676
{
7777
"title": _("NGOs registered"),
7878
"icon": "foundation",
79-
"metric": all_active_ngos["metric"],
79+
"metric": all_active_ngos()["metric"],
8080
"footer": _create_stat_link(
81-
url=f'{reverse("admin:donations_ngo_changelist")}?is_active=1', text=_("View all")
81+
url=f"{reverse('admin:donations_ngo_changelist')}?is_active=1", text=_("View all")
8282
),
83-
"timestamp": all_active_ngos["timestamp"],
83+
"timestamp": all_active_ngos()["timestamp"],
8484
},
8585
{
8686
"title": _("Functioning NGOs"),
8787
"icon": "foundation",
88-
"metric": ngos_active_in_current_year["metric"],
89-
"footer": _create_stat_link(url=f'{reverse("admin:donations_ngo_changelist")}', text=_("View all")),
90-
"timestamp": ngos_active_in_current_year["timestamp"],
88+
"metric": ngos_active_in_current_year()["metric"],
89+
"footer": _create_stat_link(url=f"{reverse('admin:donations_ngo_changelist')}", text=_("View all")),
90+
"timestamp": ngos_active_in_current_year()["timestamp"],
9191
},
9292
{
9393
"title": _("NGOs from NGO Hub"),
9494
"icon": "foundation",
95-
"metric": ngos_with_ngo_hub["metric"],
95+
"metric": ngos_with_ngo_hub()["metric"],
9696
"footer": _create_stat_link(
97-
url=f'{reverse("admin:donations_ngo_changelist")}?is_active=1&has_ngohub=1', text=_("View all")
97+
url=f"{reverse('admin:donations_ngo_changelist')}?is_active=1&has_ngohub=1", text=_("View all")
9898
),
99-
"timestamp": ngos_with_ngo_hub["timestamp"],
99+
"timestamp": ngos_with_ngo_hub()["timestamp"],
100100
},
101101
]
102102
]
@@ -146,7 +146,7 @@ def _format_yearly_stats(statistics) -> List[Dict[str, Union[int, List[Dict]]]]:
146146
"metric": statistic["donations"],
147147
"label": statistic.get("donations_difference"),
148148
"footer": _create_stat_link(
149-
url=f'{reverse("admin:donations_donor_changelist")}?date_created__year={statistic["year"]}',
149+
url=f"{reverse('admin:donations_donor_changelist')}?date_created__year={statistic['year']}",
150150
text=_("View all"),
151151
),
152152
"timestamp": statistic["timestamp"],
@@ -157,7 +157,7 @@ def _format_yearly_stats(statistics) -> List[Dict[str, Union[int, List[Dict]]]]:
157157
"metric": statistic["ngos_registered"],
158158
"label": statistic.get("ngos_registered_difference"),
159159
"footer": _create_stat_link(
160-
url=f'{reverse("admin:donations_ngo_changelist")}?date_created__year={statistic["year"]}',
160+
url=f"{reverse('admin:donations_ngo_changelist')}?date_created__year={statistic['year']}",
161161
text=_("View all"),
162162
),
163163
"timestamp": statistic["timestamp"],
@@ -168,7 +168,7 @@ def _format_yearly_stats(statistics) -> List[Dict[str, Union[int, List[Dict]]]]:
168168
"metric": statistic["ngos_with_forms"],
169169
"label": statistic.get("ngos_with_forms_difference"),
170170
"footer": _create_stat_link(
171-
url=f'{reverse("admin:donations_ngo_changelist")}?has_forms=1&date_created__year={statistic["year"]}',
171+
url=f"{reverse('admin:donations_ngo_changelist')}?has_forms=1&date_created__year={statistic['year']}",
172172
text=_("View all"),
173173
),
174174
"timestamp": statistic["timestamp"],

0 commit comments

Comments
 (0)