'Delete a rule'

def delete(self, request, project, rule_id):

    rule = Rule.objects.get(project=project, id=rule_id, status__in=[RuleStatus.ACTIVE, RuleStatus.INACTIVE])
    rule.update(status=RuleStatus.PENDING_DELETION)
    self.create_audit_entry(request=request, organization=project.organization, target_object=rule.id, event=AuditLogEntryEvent.RULE_REMOVE, data=rule.get_audit_log_data())
    return Response(status=202)
