Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
jjmontalbo committed Mar 21, 2014
1 parent 40601c5 commit c0fbc46
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion phonenumber_field/phonenumber.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,10 @@ def __len__(self):


def to_python(value):
if value in validators.EMPTY_VALUES: # None or ''
if value is None:
phone_number = None
if value in validators.EMPTY_VALUES: # None or ''
phone_number = ''
elif value and isinstance(value, basestring):
try:
phone_number = PhoneNumber.from_string(phone_number=value)
Expand Down

1 comment on commit c0fbc46

@jose-flores
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @jjmontalbo We've made a patch to honor blank field attributes on non-null phone numbers fields.

Please sign in to comment.