Update rest_framework.fields

- Use .get with default value for 'allow_null' kwarg in BooleanField's
  init
This commit is contained in:
Rodrigo 2022-10-19 12:37:04 -03:00
parent 7aa43d9c54
commit c29bb09379

View File

@ -691,7 +691,7 @@ class BooleanField(Field):
NULL_VALUES = {'null', 'Null', 'NULL', '', None}
def __init__(self, **kwargs):
if 'allow_null' in kwargs:
if kwargs.get('allow_null', False):
self.default_empty_html = None
self.initial = None
super().__init__(**kwargs)