-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
datefield and none/empty values #5365
Comments
btw, I've been able to solve the issue with this workaround ...
A view/viewset then looks like this ...
The mixin can be used for all fields which need to normalize empty strings to None (e.g. date, decimal). |
Hi @sehmaschine, Thanks for the report. I’m going to go with not a bug for now. 🙂 If you sent Your workaround is fine. It might be better at the field level in |
Checklist
master
branch of Django REST framework.I'm actually not sure if this is a bug, but I expected being able to send an empty string if a
DateField
is not required. If an empty string is not allowed, at least the error message should (IMHO) refer to something like "blank is not allowed" instead of mentioning the wrong format.I've done quite some research on this topic and also found some issues and explanations (but not an answer). Please feel free to close this if I missed something (and/or this is a duplicate).
See also #2687
The text was updated successfully, but these errors were encountered: