-
Notifications
You must be signed in to change notification settings - Fork 29
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
Custom Error Messages Not Working #13
Comments
do we have any word on if this has bee updated or not? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
DRF has a built-in way of providing custom error messages.
However, these error messages are currently ignored by 'rest_condition' classes. Instead, the default error message is always used.
In DRF, you can specify a class level attribute called message, that gets used as the error message if the permission check fails.
http://www.django-rest-framework.org/api-guide/permissions/#custom-permissions
e.g.
To fix this, It seems evaluate_permissions(....) in permissions.py could be enhanced to read the message attribute from the condition instance and set its own message attribute to that.
e.g. permissions.py
The text was updated successfully, but these errors were encountered: