Opened 23 months ago

Closed 23 months ago

Last modified 23 months ago

#33876 closed Cleanup/optimization (fixed)

"default.html" deprecation warning raised for ManagementForm's

Reported by: Claude Paroz Owned by: Carlton Gibson
Component: Forms Version: 4.1
Severity: Release blocker Keywords:
Cc: David Smith, Carlton Gibson Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

I have a project where I never render forms with the {{ form }} expression. However, I'm still getting the new template deprecation warning because of the formset management form production, during which the template used is insignificant (only hidden inputs are produced).

Is it worth special-casing this and avoid producing the warning for the management forms?

Change History (6)

comment:1 by Mariusz Felisiak, 23 months ago

Cc: David Smith Carlton Gibson added
Severity: NormalRelease blocker
Triage Stage: UnreviewedAccepted

Thanks for the report. I think it's worth changing. As far as I'm aware, it's quite often that management form is the only one that users render with {{ form }}. It should also be quite easy to workaround:

  • django/forms/formsets.py

    diff --git a/django/forms/formsets.py b/django/forms/formsets.py
    index 3adbc6979a..2bea2987be 100644
    a b class ManagementForm(Form):  
    3131    new forms via JavaScript, you should increment the count field of this form
    3232    as well.
    3333    """
     34    template_name = "django/forms/div.html"  # RemovedInDjango50Warning.
    3435
    3536    TOTAL_FORMS = IntegerField(widget=HiddenInput)
    3637    INITIAL_FORMS = IntegerField(widget=HiddenInput)

comment:2 by Carlton Gibson, 23 months ago

Owner: changed from nobody to Carlton Gibson
Status: newassigned

comment:3 by Carlton Gibson, 23 months ago

Has patch: set

comment:4 by Mariusz Felisiak, 23 months ago

Triage Stage: AcceptedReady for checkin

comment:5 by Carlton Gibson <carlton@…>, 23 months ago

Resolution: fixed
Status: assignedclosed

In 89e695a:

Fixed #33876, Refs #32229 -- Made management forms render with div.html template.

Thanks to Claude Paroz for the report.

comment:6 by Carlton Gibson <carlton.gibson@…>, 23 months ago

In 8aab03a:

[4.1.x] Fixed #33876, Refs #32229 -- Made management forms render with div.html template.

Thanks to Claude Paroz for the report.

Backport of 89e695a69b16b8c0e720169b3ca4852cfd0c485f from main

Note: See TracTickets for help on using tickets.
Back to Top