Skip to content

Commit

Permalink
return phone_number.as_e164 to be serializable
Browse files Browse the repository at this point in the history
  • Loading branch information
shahwan42 committed Oct 11, 2020
1 parent 7a5d801 commit 11747bc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion phonenumber_field/serializerfields.py
Expand Up @@ -12,4 +12,4 @@ def to_internal_value(self, data):
phone_number = to_python(data)
if phone_number and not phone_number.is_valid():
raise ValidationError(self.error_messages["invalid"])
return phone_number
return phone_number.as_e164

0 comments on commit 11747bc

Please sign in to comment.