Skip to content

Fix errors caused by attempts to report already blocked or deleted users

What does this MR do?

This MR checks if a reportedly abusive user hasn't been already blocked or deleted just before rendering the abuse report form, and redirects the reporter based on the user's state with an explanatory alert message.

It could be the case that an administrator blocks or deletes a misbehaving user a moment before a reporter requests the abuse report form. We're handling that case gracefully.

Are there points in the code the reviewer needs to double check?

  • I think adding some cases to our AbuseReportsController controller specs will suffice, but I'm not sure. I'd like to chat a little about what would be the best way to test this changeset.

Why was this MR needed?

Attempting to render the Abuse Report form when there was no active user to report resulted into a 500 error.

What are the relevant issue numbers?

Fixes #8928 (closed).

Merge request reports