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
Is this by purpose or by mistake?
I can try to make a PR with test case and fix if it is needed.
The text was updated successfully, but these errors were encountered:
FingerLiu
changed the title
UniqueTogetherValidator error message should return
UniqueTogetherValidator error message should return verbose_name
May 20, 2016
Haven't attempted to replicate, but appears to be a valid issue from the description.
Would be interesting to know if this is only an issue for the translated case, or it it's an issue always.
Also if anyone is able to replicate and confirm please do pitch in.
Checklist
master
branch of Django REST framework.Steps to reproduce
and create ModelViewSet for the model
2. create category(name='a', parent=1)
3. call create request with data (name='a', parent=1)
Expected behavior
Since I have set
USE_I18N = True
andUSE_L10N = True
, and added locale/xxx/django.po correctly.I expect a error message well translated.
Actual behavior
fields with verbose_name are not translated.
![image](https://cloud.githubusercontent.com/assets/3981064/15415524/ba1d840a-1e75-11e6-9049-951ee94a8713.png)
As below
I've inspsected the DRF code, there are not any logic dealing with verbose_name in UniqueTogetherValidator.
Currently it just get field name of serializer field and return it to error_message of UniqueTogetherValidator.
As blow
https://github.com/tomchristie/django-rest-framework/blob/master/rest_framework/validators.py#L149
Is this by purpose or by mistake?
I can try to make a PR with test case and fix if it is needed.
The text was updated successfully, but these errors were encountered: