def METHOD_NAME(request, supported):
    if request.user.is_authenticated:
        with suppress(LookupError):
            value = get_supported_language_variant(request.user.locale)
            return value if value in supported else None