use format_lazy instead of format for lazy objects #7765
Unanswered
HosseinMohammadii
asked this question in
Ideas & Suggestions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Checklist
master
branch of Django REST framework.Due to django docs for lazy objects format_lazy method should be called instead of str.format.
https://docs.djangoproject.com/en/3.1/topics/i18n/translation/#formatting-strings-format-lazy
because in serializers instead of lazy objects, str objects are passed to Exception initiation, I can't access lazy objects in exception handler.
for example in this part that it seems a little wrong
django-rest-framework/rest_framework/validators.py
Line 159 in 8351747
Thanks
Beta Was this translation helpful? Give feedback.
All reactions