def METHOD_NAME(request):
    """
    Handle logout
    """
    # Present goodbye message and logout if not anonymous
    if not request.user.is_anonymous:
        name = request.user.first_name or request.user.username
        messages.success(request, "Goodbye, {0}. Come back soon!".format(name))
        logout(request)
    # Redirect home
    return redirect("home")