|
16 | 16 | from django.core.validators import ( |
17 | 17 | EmailValidator, MaxLengthValidator, MaxValueValidator, MinLengthValidator, |
18 | 18 | MinValueValidator, ProhibitNullCharactersValidator, RegexValidator, |
19 | | - URLValidator, ip_address_validators |
| 19 | + URLValidator |
20 | 20 | ) |
21 | 21 | from django.forms import FilePathField as DjangoFilePathField |
22 | 22 | from django.forms import ImageField as DjangoImageField |
|
36 | 36 | pytz = None |
37 | 37 |
|
38 | 38 | from rest_framework import ISO_8601 |
| 39 | +from rest_framework.compat import ip_address_validators |
39 | 40 | from rest_framework.exceptions import ErrorDetail, ValidationError |
40 | 41 | from rest_framework.settings import api_settings |
41 | 42 | from rest_framework.utils import html, humanize_datetime, json, representation |
@@ -866,7 +867,7 @@ def __init__(self, protocol='both', **kwargs): |
866 | 867 | self.protocol = protocol.lower() |
867 | 868 | self.unpack_ipv4 = (self.protocol == 'both') |
868 | 869 | super().__init__(**kwargs) |
869 | | - validators, error_message = ip_address_validators(protocol, self.unpack_ipv4) |
| 870 | + validators = ip_address_validators(protocol, self.unpack_ipv4) |
870 | 871 | self.validators.extend(validators) |
871 | 872 |
|
872 | 873 | def to_internal_value(self, data): |
|
0 commit comments