Skip to content

Commit

Permalink
Don't allow NGOs to access the new admin for now
Browse files Browse the repository at this point in the history
  • Loading branch information
tudoramariei committed Dec 5, 2024
1 parent 2966db0 commit d6e7a09
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
2 changes: 1 addition & 1 deletion backend/donations/views/dashboard/dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")}
1 change: 1 addition & 0 deletions backend/redirectioneaza/settings/unfold.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"title": _("Dashboard"),
"icon": "dashboard",
"link": reverse_lazy("admin:index"),
"permission": lambda request: request.user.is_superuser,
},
],
},
Expand Down
13 changes: 11 additions & 2 deletions backend/templates/v3/admin/base_admin.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,18 @@ <h1 id="site-name">
{% endblock %}

{% block content %}
{% include "unfold/helpers/messages.html" %}
{% endblock %}

{% if display_work_in_progress %}
{% include "admin/announcements/work_in_progress.html" %}
{% endif %}

<body>

{% if redirect %}
<meta http-equiv="refresh" content="0; url={{ redirect }}"/>
{% endif %}

{% block body %}{% endblock body %}

</body>
{% endblock content %}
3 changes: 1 addition & 2 deletions backend/templates/v3/admin/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

{% load unfold i18n %}

{% block content %}

{% block body %}
{% component "unfold/components/container.html" %}

{% if header_stats %}
Expand Down

0 comments on commit d6e7a09

Please sign in to comment.