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
When a user is blocked from commenting on an article, show correct error message #15009
Conversation
|
Thank you for opening this PR! We appreciate you! For all pull requests coming from third-party forks we will need to A Forem Team member will review this contribution and get back to |
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.
Thanks for the PR @vishaldeepak!
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.
Thanks @vishaldeepak
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.
LGTM
What type of PR is this? (check all applicable)
Description
Instead of letting Pundit handle this policy, I moved the logic to the controller method. This way all other pundit validations will continue to work as before. The controller will raise an
UnauthorizedErrorwhich will be handled by the controller to return a proper error message.Related Tickets & Documents
Closes #14642
And perhaps a similar issue #14502
Probable Changes
QA Instructions, Screenshots, Recordings
Recreation can be found here -#14642 (comment)
Added/updated tests?