django-modeladmin-reorder icon indicating copy to clipboard operation
django-modeladmin-reorder copied to clipboard

Breadcrumb urls lead to error page

Open pakal opened this issue 5 years ago • 1 comments

Thansk for this package

Here is a little buglet : when I group models together under a single app-name, clicking on "cross referenced" models will lead to a page where their breadcrumb still references their real parent app. Clicking on this url will lead to an empty page, since the origianl app of these models is not listed in ADMIN_REORDER.

pakal avatar Jun 18 '19 10:06 pakal

FWIW, my little workaround for this issue:

  1. define a redirect url
  2. change verbose_name for the app

"1." solves the 404 and "2." makes it look nice.

I have a custom user model in project's users app and I wanted to move this model into the contrib.auth app / section. I suspect this is a fairly common use case.

# urls.py
path("admin/users/", RedirectView.as_view(url="/admin/auth/")),
# users/apps.py
class UsersConfig(AppConfig):
    name = "users"
    verbose_name = "Authentication and Authorization"

# users/__init__.py
default_app_config = 'users.apps.UsersConfig'

This is a bodge solution... works ok if there are no other models in the app in the admin, otherwise not applicable.

I would love to see a proper solution for this, but fear it might be very complicated :(

frnhr avatar Apr 25 '20 08:04 frnhr