Fix loading admin pages with Delete links on extension admin sites.

Review Request #12063 — Created Feb. 19, 2022 and submitted

chipx86
Review Board
release-4.0.x
reviewboard

When rendering the change form for a model on an admin site, we were
using Django's admin_urlname() function to generate the namespaced URL
name to the model.

Since this is what Django itself calls, it was expected to work
regardless of the AdminSite hosting the page. However, in reality, it
just hard-codes admin as the namespace, without caring about the
actual AdminSite.

This change removes this call entirely, switching to our own URL
building logic that respects the AdminSite name.

Tested loading normal database model change forms, and extension-provided
ones.

Tested the Delete button in each case.

Summary
Fix loading admin pages with Delete links on extension admin sites.
david
  1. Ship It!
  2. 
      
chipx86
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-4.0.x (4945c36)
Loading...