def METHOD_NAME(request, pk=None):
    if request.user.is_avatar_locked:
        if request.user.avatar_lock_user_message:
            reason = format_plaintext_for_html(request.user.avatar_lock_user_message)
        else:
            reason = None
        return Response(
            {
                "detail": pgettext(
                    "avatar api", "Your avatar is locked. You can't change it."
                ),
                "reason": reason,
            },
            status=status.HTTP_403_FORBIDDEN,
        )
    avatar_options = get_avatar_options(request, request.user)
    if request.method == "POST":
        return avatar_post(request, avatar_options)
    return Response(avatar_options)