-
-
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
Use verbose_name instead of object_name in error messages #4299
Conversation
Related to #4300. |
Yup this looks good, thanks!
|
I'll upgrade the test, could you please review my 2 commits and tell me which one is the right one? |
Current coverage is 91.19% (diff: 100%)@@ master #4299 diff @@
==========================================
Files 52 52
Lines 5776 5781 +5
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
+ Hits 5267 5272 +5
Misses 509 509
Partials 0 0
|
Sorry, could you be more explicit? |
@@ -59,7 +59,7 @@ def get_detail_view_name(model): | |||
""" | |||
return '%(model_name)s-detail' % { | |||
'app_label': model._meta.app_label, | |||
'model_name': model._meta.verbose_name.lower() | |||
'model_name': model._meta.object_name.lower() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tomchristie is it correct the way it is or should I convert this object_name
to verbose_name
too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should remain as object_name
, as you currently have it.
Closes #4300. |
Note: Before submitting this pull request, please review our contributing guidelines.
Description
It should use
verbose_name
, notobject_name
, took me 2 hours to find out why parts of error were not translated as I didn't expect it to happen in drf.