Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#28265 closed Bug (fixed)

Template widget rendering: "Add the renderer argument ..." false positive when using **kwargs

Reported by: Jon Dufresne Owned by: nobody
Component: Forms Version: 1.11
Severity: Release blocker Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

I have a custom widget with the following method:

def render(self, *args, **kwargs):
    self.pre_render_setup(*args, **kwargs)
    try:
        super().render(*args, **kwargs)
    finally:
        self.post_render_cleanup(*args, **kwargs)

Starting with Django 1.11 every use of this widget spews the following warning:

.../venv/lib64/python3.5/site-packages/django/forms/boundfield.py:41: RemovedInDjango21Warning: Add the `renderer` argument to the render() method of <class '...'>. It will be mandatory in Django 2.1.

As I'm using **kwargs, the renderer value is correctly passed on to the render() function. This warning should be silenced.

Change History (4)

comment:1 by Tim Graham, 7 years ago

Severity: NormalRelease blocker
Triage Stage: UnreviewedAccepted

comment:2 by Jon Dufresne, 7 years ago

Has patch: set

comment:3 by Tim Graham <timograham@…>, 7 years ago

Resolution: fixed
Status: newclosed

In 29a5180:

Fixed #28265 -- Prevented renderer warning on Widget.render() with kwargs.

comment:4 by Tim Graham <timograham@…>, 7 years ago

In 1940e3d:

[1.11.x] Fixed #28265 -- Prevented renderer warning on Widget.render() with kwargs.

Backport of 29a518006f7f96186483fa50e249e1c3f21728d5 from master

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