Error about formatting datefields in serializer #8369
Unanswered
rvcadding
asked this question in
Potential Issue
Replies: 1 comment
-
how to translate "Date has wrong format. Use one of these formats instead: DD-MM-YYYY." this text? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi
I am in the following situation:
I have a serializer and I can't manage to validate the data due to a validation error about the date format, although I am sure the date format is correct. I would like to keep the field as optional, but I can't make it work when I pass the date value. When I don't pass any value, the serializer works correctly.
Example:
In my local environment, the serializer works correctly, but in a remote development environment (Kubernetes pod), the following error happens: Validation error:
{'date_x': [ErrorDetail(string='Date has wrong format. Use one of these formats instead: YYYY-MM-DD.', code='invalid')]}
Note: There are no differences in settings between the environments.
I have tried:
About the environment:
Django 2.1.7
djangorestframework 3.9.2
Python 3.6.14
current relevant settings:
I would appreciate any kind of help.
Thanks in advance
Beta Was this translation helpful? Give feedback.
All reactions