We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0f77c27 commit b6c4d8cCopy full SHA for b6c4d8c
rest_framework/utils/field_mapping.py
@@ -185,6 +185,13 @@ def get_field_kwargs(field_name, model_field):
185
if validator is not validators.validate_slug
186
]
187
188
+ # IPAddressField do not need to include the 'validate_ipv46_address' argument,
189
+ if isinstance(model_field, models.GenericIPAddressField):
190
+ validator_kwarg = [
191
+ validator for validator in validator_kwarg
192
+ if validator is not validators.validate_ipv46_address
193
+ ]
194
+
195
if getattr(model_field, 'unique', False):
196
validator = UniqueValidator(queryset=model_field.model._default_manager)
197
validator_kwarg.append(validator)
0 commit comments