def METHOD_NAME(pk: int) -> str:
    try:
        alert = Alert.objects.get(pk=pk)
    except Alert.DoesNotExist:
        return "alert not found"
    # first time sending email
    if not alert.resolved_email_sent:
        task_result = TaskResult.objects.get(
            task=alert.assigned_task, agent=alert.agent
        )
        sleep(rand_range(100, 1500))
        task_result.send_resolved_email()
        alert.resolved_email_sent = djangotime.now()
        alert.save(update_fields=["resolved_email_sent"])
    return "ok"