Skip to content

405 when deleting infractions that fail to apply #1033

@MarkKoz

Description

@MarkKoz

Sentry Issue: BOT-6Q

The infractions viewset doesn't support deleting infractions, but it's done here:

if failed:
log.trace(f"Deleted infraction {infraction['id']} from database because applying infraction failed.")
try:
await self.bot.api_client.delete(f"bot/infractions/{id_}")
except ResponseCodeError as e:
confirm_msg += " and failed to delete"
log_title += " and failed to delete"
log.error(f"Deletion of {infr_type} infraction #{id_} failed with error code {e.status}.")

This is to delete infractions when they fail to apply on the Discord side of things. Should DELETE support be added to the API or can we re-order things to not have to later delete infractions? #986 is very relevant to this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    a: APIRelated to or causes API changesa: moderationRelated to community moderation functionality: (moderation, defcon, verification)p: 2 - normalNormal Prioritys: planningDiscussing detailst: bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions