﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
32225	Edit popup in model 'change' page results in a not found if the foreign key model contains a space	Mathis	nobody	"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."	Bug	closed	contrib.admin	3.1	Normal	duplicate	admin, edit		Unreviewed	0	0	0	0	0	0
