Skip to content

Commit 2966db0

Browse files
committed
Move the WiP warning
1 parent 0da5a92 commit 2966db0

File tree

3 files changed

+18
-13
lines changed

3 files changed

+18
-13
lines changed

backend/donations/views/dashboard/admin_dashboard.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
from typing import Dict, List, Union
22

33
from django.conf import settings
4-
from django.contrib import messages
5-
from django.template.loader import render_to_string
64
from django.urls import reverse
75
from django.utils.safestring import mark_safe
86
from django.utils.timezone import now
@@ -25,16 +23,6 @@ def callback(request, context) -> Dict:
2523
today = now()
2624
years_range_ascending = get_current_year_range()
2725

28-
messages.warning(
29-
request,
30-
render_to_string(
31-
"admin/announcements/work_in_progress.html",
32-
context={
33-
"contact_email": settings.CONTACT_EMAIL_ADDRESS,
34-
},
35-
),
36-
)
37-
3826
header_stats: List[List[Dict[str, Union[str, int]]]] = _get_header_stats(today)
3927

4028
yearly_stats: List[Dict] = _get_yearly_stats(years_range_ascending)

backend/donations/views/dashboard/dashboard.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,27 @@
11
from django.contrib.auth import get_user_model
2+
from django.urls import reverse
3+
from django.contrib import messages
4+
from django.template.loader import render_to_string
5+
from django.conf import settings
26

37
from .admin_dashboard import callback as admin_callback
4-
from .ngo_dashboard import callback as ngo_callback
58

69
UserModel = get_user_model()
710

811

912
def callback(request, context):
1013
user: UserModel = request.user
1114

15+
messages.warning(
16+
request,
17+
render_to_string(
18+
"admin/announcements/work_in_progress.html",
19+
context={
20+
"contact_email": settings.CONTACT_EMAIL_ADDRESS,
21+
},
22+
),
23+
)
24+
1225
if not user or not user.is_authenticated:
1326
return context
1427

backend/templates/v3/admin/base_admin.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,7 @@ <h1 id="site-name">
2323
{% block content %}
2424
{% include "unfold/helpers/messages.html" %}
2525
{% endblock %}
26+
27+
{% if display_work_in_progress %}
28+
{% include "admin/announcements/work_in_progress.html" %}
29+
{% endif %}

0 commit comments

Comments
 (0)