mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-25 15:39:58 +03:00
Update rest_framework.fields
- Use .get with default value for 'allow_null' kwarg in BooleanField's init
This commit is contained in:
parent
7aa43d9c54
commit
c29bb09379
|
@ -691,7 +691,7 @@ class BooleanField(Field):
|
||||||
NULL_VALUES = {'null', 'Null', 'NULL', '', None}
|
NULL_VALUES = {'null', 'Null', 'NULL', '', None}
|
||||||
|
|
||||||
def __init__(self, **kwargs):
|
def __init__(self, **kwargs):
|
||||||
if 'allow_null' in kwargs:
|
if kwargs.get('allow_null', False):
|
||||||
self.default_empty_html = None
|
self.default_empty_html = None
|
||||||
self.initial = None
|
self.initial = None
|
||||||
super().__init__(**kwargs)
|
super().__init__(**kwargs)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user