-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
3.15.0 - bug in rendering %
characters from ValidationError
#9295
Comments
This is coming from #8863, which is very difficult to live with. The original motivation of that, from #8077, had a reason of using more standard Django / python exception argument. But if you look at the Django error behavior: from django.core.exceptions import ValidationError as dValidationError
dValidationError("Expects format %Y-%m-%d %H:%M:%S")
dValidationError("Expects format %Y-%m-%d %H:%M:%S").error_list It does no similar formatting when given such a string. |
related fix #9313 |
With the new update, we have encountered a regression issue: Given the string "%22safe," which is not a format string, Example: raise ValidationError('%22safe') Result:
Notes: |
The new
3.15.0
release introduced a bug in rendering errors from theValidationError
exception class.Given a serializer:
Calling
ValidationError
would raise the exception:As expected, this can easily be reproduced in the console:
or
A solution would be to escape with double
%
characters any occurrence of%
in the error messages.Unsure this is a choice by design or not, as this wouldn't be the case on
3.14.x
?The text was updated successfully, but these errors were encountered: