In Django 1.11, these attributes now render as `="False"`. This is because
the
[https://github.com/django/django/blob/12cefee5d84b3569ccbde03167c7853e8dac638f/django/forms/templates/django/forms/widgets/attrs.html
attrs.html template] only looks for the boolean value `True`.
This forces code of the form:
{{{
attrs['readonly'] = some_bool_condition()
}}}
To:
{{{
if some_bool_condition():
attrs['readonly'] = True
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/27759>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* has_patch: 0 => 1
* needs_tests: 0 => 1
Comment:
[https://github.com/django/django/pull/7925 PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/27759#comment:1>
* needs_tests: 1 => 0
Comment:
Added test.
--
Ticket URL: <https://code.djangoproject.com/ticket/27759#comment:2>
* stage: Unreviewed => Ready for checkin
--
Ticket URL: <https://code.djangoproject.com/ticket/27759#comment:3>
* status: new => closed
* resolution: => fixed
Comment:
In [changeset:"5fa390ee81c5a963fc4476e8de6c1e5e1fc57e22" 5fa390e]:
{{{
#!CommitTicketReference repository=""
revision="5fa390ee81c5a963fc4476e8de6c1e5e1fc57e22"
Fixed #27759 -- Prevented forms attrs.html template from rendering False
attrs.
Regression in b52c73008a9d67e9ddbb841872dc15cdd3d6ee01.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/27759#comment:4>
Comment (by Tim Graham <timograham@…>):
In [changeset:"9e9d0f8ef7577f2369cb91115d159c950ad81e3e" 9e9d0f8]:
{{{
#!CommitTicketReference repository=""
revision="9e9d0f8ef7577f2369cb91115d159c950ad81e3e"
[1.11.x] Fixed #27759 -- Prevented forms attrs.html template from
rendering False attrs.
Regression in b52c73008a9d67e9ddbb841872dc15cdd3d6ee01.
Backport of 5fa390ee81c5a963fc4476e8de6c1e5e1fc57e22 from master
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/27759#comment:5>