Skip to content

Commit d6e7a09

Browse files
committed
Don't allow NGOs to access the new admin for now
1 parent 2966db0 commit d6e7a09

File tree

4 files changed

+14
-5
lines changed

4 files changed

+14
-5
lines changed

backend/donations/views/dashboard/dashboard.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ def callback(request, context):
2828
if user.is_admin:
2929
return admin_callback(request, context)
3030

31-
return ngo_callback(request, context)
31+
return {"redirect": reverse("contul-meu")}

backend/redirectioneaza/settings/unfold.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"title": _("Dashboard"),
1717
"icon": "dashboard",
1818
"link": reverse_lazy("admin:index"),
19+
"permission": lambda request: request.user.is_superuser,
1920
},
2021
],
2122
},

backend/templates/v3/admin/base_admin.html

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,18 @@ <h1 id="site-name">
2121
{% endblock %}
2222

2323
{% block content %}
24-
{% include "unfold/helpers/messages.html" %}
25-
{% endblock %}
2624

2725
{% if display_work_in_progress %}
2826
{% include "admin/announcements/work_in_progress.html" %}
2927
{% endif %}
28+
29+
<body>
30+
31+
{% if redirect %}
32+
<meta http-equiv="refresh" content="0; url={{ redirect }}"/>
33+
{% endif %}
34+
35+
{% block body %}{% endblock body %}
36+
37+
</body>
38+
{% endblock content %}

backend/templates/v3/admin/index.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22

33
{% load unfold i18n %}
44

5-
{% block content %}
6-
5+
{% block body %}
76
{% component "unfold/components/container.html" %}
87

98
{% if header_stats %}

0 commit comments

Comments
 (0)