This appears to be caused by the following line in
`django.contrib.admin.helpers` `get_admin_url`:
`url = reverse(url_name, args=[quote(remote_obj.pk)])`
Other parts of the admin use the `current_app` keyword parameter to
identify the correct current name of the Admin Site. (See
django.contrib.admin.options.ModelAdmin response_add as just one example)
I have been able to correct this specific issue by replacing the above
line with:
{{{
url = reverse(
url_name,
args=[quote(remote_obj.pk)],
current_app=self.model_admin.admin_site.name
)
}}}
However, I don't know if there are any side effects and I have not yet run
the full suite of tests on this. Mostly looking for feedback whether I'm
on the right track.
--
Ticket URL: <https://code.djangoproject.com/ticket/33077>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* severity: Normal => Release blocker
* stage: Unreviewed => Accepted
Comment:
Hey Ken, yes seems right. Good spot.
Looks like this should have been part of
b79088306513d5ed76d31ac40ab3c15f858946ea for #31181 (which was Django
3.2)
[https://github.com/django/django/commit/b79088306513d5ed76d31ac40ab3c15f858946ea
#diff-07734f3e730920ea3922e6de9cb783825f009817b53e16ece8c3c2e3fdb41e40R199
here].
> However, I don't know if there are any side effects and I have not yet
run the full suite of tests on this. Mostly looking for feedback whether
I'm on the right track.
I ran your suggestion against most of the ''usual suspects'' `admin_*`
tests without issue so...
Would you like to prepare a patch? Looks like setting up the test case is
the most of it...
Thanks!
--
Ticket URL: <https://code.djangoproject.com/ticket/33077#comment:1>
Comment (by Ken Whitesell):
I'll be happy to try - but I'm not likely to be able to get to it before
the weekend. (I don't know how "urgent" you consider it.) If it can sit
that long, I'll see what I can do. (First "real patch" and all that - want
to make sure I do it reasonably right.)
--
Ticket URL: <https://code.djangoproject.com/ticket/33077#comment:2>
* owner: nobody => Ken Whitesell
* status: new => assigned
Comment:
Hey Ken. Super thanks!
Since it's a ''bug in a new feature'' it's marked as release blocker and
will be backported to Django 3.2.
We'll target [https://docs.djangoproject.com/en/dev/releases/3.2.8/ 3.2.8,
which is slated for the beginning of October].
If it gets close to that and you've not had time we can pick it up.
Reach out on the Forum if you'd like input at all. 🙂
Thanks! (And Welcome Aboard! ⛵️)
--
Ticket URL: <https://code.djangoproject.com/ticket/33077#comment:3>
* owner: Ken Whitesell => Abhijith Ganesh
--
Ticket URL: <https://code.djangoproject.com/ticket/33077#comment:4>
Comment (by Abhijith Ganesh):
Heyy folks, I wanted to assign the ticket to myself and fix the issue,
instead it assigned the ownership to me. Apologies
--
Ticket URL: <https://code.djangoproject.com/ticket/33077#comment:5>
* owner: Abhijith Ganesh => Ken Whitesell
Comment:
Changes ownership again.
--
Ticket URL: <https://code.djangoproject.com/ticket/33077#comment:6>
Comment (by Abhijith Ganesh):
I am trying to assign this to myself. So forgive me if I commit a message.
--
Ticket URL: <https://code.djangoproject.com/ticket/33077#comment:7>
Comment (by Carlton Gibson):
Hi Abhijith — just to confirm, according to the discussion Ken is
currently working on this ticket, so let's give him a window to do that
before re-assigning it. Thanks! (I think that's the conclusion you came
to, but just double-checking so you don't both work on the same ticket at
the same time.)
--
Ticket URL: <https://code.djangoproject.com/ticket/33077#comment:8>
* needs_better_patch: 0 => 1
* has_patch: 0 => 1
Comment:
[https://github.com/django/django/pull/14855 PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/33077#comment:9>
* owner: Ken Whitesell => (none)
* status: assigned => new
Comment:
Sorry, I just can't seem to get the hang of working with git the way you
want things done. I'm removing my self from the ticket so that it's
available for anyone else wanting to move forward with it.
--
Ticket URL: <https://code.djangoproject.com/ticket/33077#comment:10>
Comment (by Carlton Gibson):
Hey Ken. No problem. The PR is essentially there. Mariusz or I can pick
it up to make the small edits and rebase etc. Thanks for the report and
the fix. Welcome aboard!
--
Ticket URL: <https://code.djangoproject.com/ticket/33077#comment:11>
* owner: (none) => Ken Whitesell
* needs_better_patch: 1 => 0
* status: new => assigned
* stage: Accepted => Ready for checkin
--
Ticket URL: <https://code.djangoproject.com/ticket/33077#comment:12>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"0a9aa02e6f1d1b9ceca155d281a2be624bb1d3a2" 0a9aa02e]:
{{{
#!CommitTicketReference repository=""
revision="0a9aa02e6f1d1b9ceca155d281a2be624bb1d3a2"
Fixed #33077 -- Fixed links to related models for admin's readonly fields
in custom admin site.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/33077#comment:13>
Comment (by Mariusz Felisiak <felisiak.mariusz@…>):
In [changeset:"d4a587a5fac5fbda4e5688029d8c4cb04bf81c36" d4a587a5]:
{{{
#!CommitTicketReference repository=""
revision="d4a587a5fac5fbda4e5688029d8c4cb04bf81c36"
[3.2.x] Fixed #33077 -- Fixed links to related models for admin's readonly
fields in custom admin site.
Backport of 0a9aa02e6f1d1b9ceca155d281a2be624bb1d3a2 from main
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/33077#comment:14>