mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-02-02 20:54:42 +03:00
remove unnecessary check
This commit is contained in:
parent
de72022f80
commit
c44376c613
|
@ -669,17 +669,13 @@ class IPAddressField(CharField):
|
|||
self.validators.extend(validators)
|
||||
|
||||
def to_internal_value(self, data):
|
||||
if data == '' and self.allow_blank:
|
||||
return ''
|
||||
data = data.strip()
|
||||
|
||||
if data and ':' in data:
|
||||
try:
|
||||
return clean_ipv6_address(data, self.unpack_ipv4)
|
||||
except DjangoValidationError:
|
||||
self.fail('invalid', value=data)
|
||||
|
||||
return data
|
||||
return super(IPAddressField, self).to_internal_value(data)
|
||||
|
||||
|
||||
# Number types...
|
||||
|
|
Loading…
Reference in New Issue
Block a user