#32225: Admin panel: edit popup in model 'change' page results in a not found if
the foreign key model contains a space
-----------------------------------------+-----------------------------
Reporter: Mathis | Owner: nobody
Type: Uncategorized | Status: new
Component: contrib.admin | Version: 3.1
Severity: Normal | Keywords: admin, edit
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-----------------------------------------+-----------------------------
In the 'change' page of the admin panel, if we try to edit a model linked
by ForeignKey which contains a space in the 'to_field' property, the
result is a 'not found page'.
Example:
{{{
class Media(models.Model):
author = models.ForeignKey('Author', verbose_name="Author",
on_delete=models.SET_NULL, to_field="name", default="Unknown", null=True)
}}}
In this case, if the Author.name contains a space, the generated URL to
edit this author will be:
https://domain.com/admin/web_app/author/Spaced%20Name/change/?_to_field=name&_popup=1
The result is (in french with a translation, sorry):
[[Image(https://i.ibb.co/whYXg2Q/Administration.png)]]
The strange thing is that I can't reproduce this behaviour in my local
version.
--
Ticket URL: <https://code.djangoproject.com/ticket/32225>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/048.59fd2b99b4fbd233b562bcfb8249d64d%40djangoproject.com.