Skip to content

Commit

Permalink
Add reverse call back
Browse files Browse the repository at this point in the history
  • Loading branch information
summerthe committed Apr 17, 2024
1 parent 29532bc commit b23d552
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/formula/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,12 @@
######################################################################
# Unfold
######################################################################
def reverse_callback(request):
if request.user.is_superuser:
return reverse_lazy("admin:formula_driver_changelist")
else:
return reverse_lazy("admin:auth_group_changelist")

UNFOLD = {
"SITE_HEADER": _("Formula Admin"),
"SITE_TITLE": _("Formula Admin"),
Expand All @@ -208,7 +214,7 @@
{
"title": _("Drivers"),
"icon": "sports_motorsports",
"link": reverse_lazy("admin:formula_driver_changelist"),
"link": reverse_callback,
},
{
"title": _("Constructors"),
Expand Down

0 comments on commit b23d552

Please sign in to comment.