Limit abuse reports to one per reporter per category
What does this MR do and why?
This MR implements https://gitlab.com/gitlab-org/modelops/anti-abuse/team-tasks/-/issues/181.
In !106028 (merged), we allowed multiple users to report an abusive user (only one user can report an abusive user in the past).
Now that we have categories for abuse reports (added in !105316 (merged)), this MR limits the reports a user can create to one per category.
Screenshots or screen recordings
Notice that the error is generic (You have already reported this user
) and doesn't indicate the category. This is intentional (see discussion).
Screen_Recording_2023-01-10_at_10.56.04_AM
How to set up and validate locally
- Go to a user's profile page
- Report the user for spam
- Validate that the abuse report is created
- Go back to the user's profile page and report the user again for spam
- Validate that the error
You have already reported this user
is displayed - Go back to the user's profile page and report the user using another category
- Validate that the abuse report is created
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Eugie Limpin