"""Brand-related utility functions.""" from permissions.constants import constants def default_brand_from_brand(brand: str) -> str: """Convert a brand to its default brand (auth0 org). On the identity node, defaultBrand (despite the name) should actually be an auth0 org. Brands in PROFILE_BRANDS have an auth0 org of the same name; others should default to 'theorchard'. Args: brand: The brand to convert. Returns: The default brand (auth0 org) for the given brand. """ if brand in constants.PROFILE_BRANDS: return brand elif brand in constants.SME_BRANDS: return constants.SONY_BRAND else: return constants.THEORCHARD_BRAND