﻿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
35979	"Empty form ErrorList display as square brackets ""[]"""	Benjamin Mampaey		"This is probably not a Django bug, it does not appear when running Django with manage.py runserver, but appears when running django with apache2 and some versions of mod_wsgi. I believe it should be made public so that if other people stumble on that problem, they know how to fix it.

In the admin templates, when forms are displayed, if there are no errors, there is a pair of square brackets above the label. For example in the login form, it shows a pair of square brackets above the label ""Username"".

From what I could find, mod_wsgi uses sub interpreters, and in version below 2.12.5 there is a bug where the MRO for !__str!__ is not properly done https://mliezun.github.io/2024/08/19/cpython-subinterpreters.html.

In the admin template, form errors are displayed using the !__str!__ method, for example in the login template, for the Username field :

{{{
  <div class=""form-row"">
    {{ form.username.errors }}
    {{ form.username.label_tag }} {{ form.username }}
  </div>
}}}

And the definition of ErrorList is

{{{
class ErrorList(UserList, list, RenderableErrorMixin)
}}}

Thus, because of the bug, when calling the !__str!__ method of ErrorList, instead of calling the !__str!__ method of RenderableErrorMixin, that returns an empty string '', it is the !__str!__ method of list that is called that returns '[]'."	Uncategorized	closed	Forms	5.1	Normal	invalid			Unreviewed	0	0	0	0	0	1
