Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed empty "for" attribute for checkboxes #1157

Merged
merged 1 commit into from
May 11, 2021

Conversation

smithdc1
Copy link
Member

The id_for_label is None for CheckboxSelectMultiple when rendering the field label. This change avoids rendering for="" in this scenario. See https://github.com/django/django/blob/main/django/forms/widgets.py#L784

I looked at the other Bootstrap templates and they seem to use field.auto_id instead of field.id_for_label. Think we'll leave those alone.

The `id_for_label` is None for CheckboxSelectMultiple when rendering the field label.
This change avoids rendering `for=""` in this scenario. See
https://github.com/django/django/blob/main/django/forms/widgets.py#L784
@codecov-commenter
Copy link

codecov-commenter commented May 11, 2021

Codecov Report

Merging #1157 (67534e5) into main (79714a6) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1157   +/-   ##
=======================================
  Coverage   97.24%   97.24%           
=======================================
  Files          23       23           
  Lines        2906     2906           
  Branches      243      243           
=======================================
  Hits         2826     2826           
  Misses         39       39           
  Partials       41       41           
Flag Coverage Δ
unittests 97.24% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 79714a6...67534e5. Read the comment docs.

@smithdc1 smithdc1 merged commit f5185a1 into django-crispy-forms:main May 11, 2021
@smithdc1 smithdc1 deleted the for branch May 11, 2021 17:55
@smithdc1 smithdc1 added this to the Next Release milestone May 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants