You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have reduced the issue to the simplest possible case.
I have included a failing test as a pull request. (If you are unable to do so we can still accept the issue.)
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
The text was updated successfully, but these errors were encountered:
I faced with not expected behaviour of IPAddress field during validation certain types of input.
Checklist
master
branch of Django REST framework.Steps to reproduce
Expected behavior
Validation error with usual text:
['Enter a valid IPv4 or IPv6 address.']
Actual behavior
Exception:
The text was updated successfully, but these errors were encountered: