diff --git a/backend/donations/views/dashboard/dashboard.py b/backend/donations/views/dashboard/dashboard.py index cad56f0d..5819288a 100644 --- a/backend/donations/views/dashboard/dashboard.py +++ b/backend/donations/views/dashboard/dashboard.py @@ -28,4 +28,4 @@ def callback(request, context): if user.is_admin: return admin_callback(request, context) - return ngo_callback(request, context) + return {"redirect": reverse("contul-meu")} diff --git a/backend/redirectioneaza/settings/unfold.py b/backend/redirectioneaza/settings/unfold.py index a6977804..c3e1f6f7 100644 --- a/backend/redirectioneaza/settings/unfold.py +++ b/backend/redirectioneaza/settings/unfold.py @@ -16,6 +16,7 @@ "title": _("Dashboard"), "icon": "dashboard", "link": reverse_lazy("admin:index"), + "permission": lambda request: request.user.is_superuser, }, ], }, diff --git a/backend/templates/v3/admin/base_admin.html b/backend/templates/v3/admin/base_admin.html index 17dce38c..30d0a8c3 100644 --- a/backend/templates/v3/admin/base_admin.html +++ b/backend/templates/v3/admin/base_admin.html @@ -21,9 +21,18 @@

{% endblock %} {% block content %} - {% include "unfold/helpers/messages.html" %} -{% endblock %} {% if display_work_in_progress %} {% include "admin/announcements/work_in_progress.html" %} {% endif %} + + + + {% if redirect %} + + {% endif %} + + {% block body %}{% endblock body %} + + +{% endblock content %} diff --git a/backend/templates/v3/admin/index.html b/backend/templates/v3/admin/index.html index 99394c31..ec740667 100644 --- a/backend/templates/v3/admin/index.html +++ b/backend/templates/v3/admin/index.html @@ -2,8 +2,7 @@ {% load unfold i18n %} -{% block content %} - +{% block body %} {% component "unfold/components/container.html" %} {% if header_stats %}