mirror of
https://github.com/django/django.git
synced 2025-11-07 07:15:35 +00:00
Fixed #31073 -- Prevented CheckboxInput.get_context() from mutating attrs.
This commit is contained in:
committed by
Mariusz Felisiak
parent
3fb7c12158
commit
02eff7ef60
@@ -522,9 +522,7 @@ class CheckboxInput(Input):
|
||||
|
||||
def get_context(self, name, value, attrs):
|
||||
if self.check_test(value):
|
||||
if attrs is None:
|
||||
attrs = {}
|
||||
attrs['checked'] = True
|
||||
attrs = {**(attrs or {}), 'checked': True}
|
||||
return super().get_context(name, value, attrs)
|
||||
|
||||
def value_from_datadict(self, data, files, name):
|
||||
|
||||
Reference in New Issue
Block a user