Custom permissions messages don't work with logical operators #8639
Unanswered
MrCordeiro
asked this question in
Potential Issue
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I was having trouble implementing a custom error message for classes that use logical operators. For example:
Will yield the following response data:
{'detail': ErrorDetail(string='You do not have permission to perform this action.', code='permission_denied')}
This is because the
OperationHolderMixin
lacks amessage
attribute for thecheck_permissions
method to pass forward.Does it make sense to add logic that determine how logical permissions should deal with with custom messages of their children? For example:
message
attribute and the other doesn't, use that message;message
attribute, use the first one.Beta Was this translation helpful? Give feedback.
All reactions