Skip to content

Commit

Permalink
feat: validate if value of internal type
Browse files Browse the repository at this point in the history
  • Loading branch information
pity7736 committed Mar 28, 2021
1 parent 2e22662 commit 508f8c9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions nyoibo/fields.c

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion nyoibo/fields.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ cdef class Field:
value = self._parse(value)
if value and self.choices:
return self.choices(value)
if value is None or type(value) is self._internal_type:
if value is None or isinstance(value, self._internal_type):
return value
return self._internal_type(value)
except self._exceptions:
Expand Down

0 comments on commit 508f8c9

Please sign in to comment.