mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-04 20:40:14 +03:00
Stupidly referenced an attribute that will not always be populated. Replaced with a call to getattr with a default None value
This commit is contained in:
parent
5fc253d886
commit
026f164f7a
|
@ -290,7 +290,7 @@ class Field(object):
|
|||
if data is empty:
|
||||
if getattr(self.root, 'partial', False):
|
||||
raise SkipField()
|
||||
if self.required and not self.allow_blank:
|
||||
if self.required and not getattr(self, 'allow_blank', None):
|
||||
self.fail('required')
|
||||
return self.get_default()
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user