I faced with not expected behaviour of IPAddress field during validation certain types of input.
Checklist
Steps to reproduce
- Create a serializer with IPAddressField
- Pass not iterable object as input for the serializer. E.g. integer.
Expected behavior
Validation error with usual text:
['Enter a valid IPv4 or IPv6 address.']
Actual behavior
Exception:
rest_framework/fields.py:701: in run_validation
return super(CharField, self).run_validation(data)
rest_framework/fields.py:487: in run_validation
value = self.to_internal_value(data)
rest_framework/fields.py:807: in to_internal_value
if data and ':' in data:
E TypeError: argument of type 'int' is not iterable
I faced with not expected behaviour of IPAddress field during validation certain types of input.
Checklist
masterbranch of Django REST framework.Steps to reproduce
Expected behavior
Validation error with usual text:
['Enter a valid IPv4 or IPv6 address.']Actual behavior
Exception: