Skip to content
This repository has been archived by the owner on May 5, 2021. It is now read-only.

Commit

Permalink
Don't run validation when value is None for DictFields
Browse files Browse the repository at this point in the history
  • Loading branch information
richardhill-depop committed Jan 6, 2020
1 parent 4044cdc commit ade3427
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions drf_compound_fields/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ def validate(self, value):

self.validate_is_dict(value)

if self.value_field:
if self.value_field and value is not None:
errors = {}
for k, v in six.iteritems(value):
try:
Expand All @@ -204,7 +204,7 @@ def validate(self, value):
def run_validators(self, value):
super(DictField, self).run_validators(value)

if self.value_field:
if self.value_field and value is not None:
errors = {}
for k, v in six.iteritems(value):
try:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def run(self):

setup(
name='drf-compound-fields',
version='0.2.2.post2',
version='0.2.2.post3',
description='Django-REST-framework serializer fields for compound types.',
long_description=readme + '\n\n' + history,
author='Steven Cummings',
Expand Down

0 comments on commit ade3427

Please sign in to comment.