Re: [Django] #35716: Undefined template variables on Admin's add page templates when using fieldsets

17 views
Skip to first unread message

Django

unread,
Aug 29, 2024, 3:03:17 PM8/29/24
to django-...@googlegroups.com
#35716: Undefined template variables on Admin's add page templates when using
fieldsets
-------------------------------------+-------------------------------------
Reporter: Fábio Domingues | Owner: Sarah
Type: | Boyce
Cleanup/optimization | Status: assigned
Component: contrib.admin | Version: 5.1
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sarah Boyce):

* needs_better_patch: 1 => 0
* needs_tests: 1 => 0
* owner: (none) => Sarah Boyce
* status: new => assigned

--
Ticket URL: <https://code.djangoproject.com/ticket/35716#comment:4>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Aug 29, 2024, 4:51:38 PM8/29/24
to django-...@googlegroups.com
#35716: Undefined template variables on Admin's add page templates when using
fieldsets
-------------------------------------+-------------------------------------
Reporter: Fábio Domingues | Owner: Sarah
Type: | Boyce
Cleanup/optimization | Status: assigned
Component: contrib.admin | Version: 5.1
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Adam Johnson):

> (Adam, I'm adding you as cc since you added yourself to #28526.)

Thanks :)

Honestly, I think the `string_if_invalid` feature brings more pain than
it’s worth, after investigating it a bit for a client last year. You can
see all the ways that I found it goes wrong in
[https://adamj.eu/tech/2023/08/09/django-perils-string-if-invalid/ this
blog post].

I’d still be happy for small template changes to let it keep “working”.
But in the long run, I think it would be better for Django to deprecate
`string_if_invalid` and use a Jinja-style “undefined variable class”, as I
hinted at in the conclusion of that post.
--
Ticket URL: <https://code.djangoproject.com/ticket/35716#comment:5>

Django

unread,
Aug 30, 2024, 8:55:34 AM8/30/24
to django-...@googlegroups.com
#35716: Undefined template variables on Admin's add page templates when using
fieldsets
-------------------------------------+-------------------------------------
Reporter: Fábio Domingues | Owner: Sarah
Type: | Boyce
Cleanup/optimization | Status: assigned
Component: contrib.admin | Version: 5.1
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Natalia Bidart):

* severity: Normal => Release blocker
* stage: Accepted => Ready for checkin

Comment:

Marking as release blocker since this was a regression in
01ed59f753139afb514170ee7f7384c155ecbc2d.
--
Ticket URL: <https://code.djangoproject.com/ticket/35716#comment:6>

Django

unread,
Aug 30, 2024, 2:49:36 PM8/30/24
to django-...@googlegroups.com
#35716: Undefined template variables on Admin's add page templates when using
fieldsets
-------------------------------------+-------------------------------------
Reporter: Fábio Domingues | Owner: Sarah
Type: | Boyce
Cleanup/optimization | Status: closed
Component: contrib.admin | Version: 5.1
Severity: Release blocker | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sarah Boyce <42296566+sarahboyce@…>):

* resolution: => fixed
* status: assigned => closed

Comment:

In [changeset:"fd1dd767783b5a7ec1a594fcc5885e7e4178dd26" fd1dd767]:
{{{#!CommitTicketReference repository=""
revision="fd1dd767783b5a7ec1a594fcc5885e7e4178dd26"
Fixed #35716 -- Fixed VariableDoesNotExist when rendering admin fieldsets.

Regression in 01ed59f753139afb514170ee7f7384c155ecbc2d.

Thank you to Fábio Domingues and Marijke Luttekes for the report,
and thank you to Natalia Bidart for the review.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/35716#comment:7>

Django

unread,
Aug 30, 2024, 2:53:25 PM8/30/24
to django-...@googlegroups.com
#35716: Undefined template variables on Admin's add page templates when using
fieldsets
-------------------------------------+-------------------------------------
Reporter: Fábio Domingues | Owner: Sarah
Type: | Boyce
Cleanup/optimization | Status: closed
Component: contrib.admin | Version: 5.1
Severity: Release blocker | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Sarah Boyce <42296566+sarahboyce@…>):

In [changeset:"62039659603ca0fa2df796d1732c4b414549c52b" 6203965]:
{{{#!CommitTicketReference repository=""
revision="62039659603ca0fa2df796d1732c4b414549c52b"
[5.1.x] Fixed #35716 -- Fixed VariableDoesNotExist when rendering admin
fieldsets.

Regression in 01ed59f753139afb514170ee7f7384c155ecbc2d.

Thank you to Fábio Domingues and Marijke Luttekes for the report,
and thank you to Natalia Bidart for the review.

Backport of fd1dd767783b5a7ec1a594fcc5885e7e4178dd26 from main.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/35716#comment:8>
Reply all
Reply to author
Forward
0 new messages