def REGION_TO_RATINGS_BODY(): """ Return a map of region slugs to ratings body labels for use in serializers and to send to Fireplace. e.g. {'us': 'esrb', 'mx': 'esrb', 'es': 'pegi', 'br': 'classind'}. """ # Create the mapping. region_to_bodies = {} for region in ALL_REGIONS_WITH_CONTENT_RATINGS(): ratings_body_label = GENERIC_RATING_REGION_SLUG if region.ratingsbody: ratings_body_label = slugify_iarc_name(region.ratingsbody) region_to_bodies[region.slug] = ratings_body_label return region_to_bodies
def REGION_TO_RATINGS_BODY(): """ Return a map of region slugs to ratings body labels for use in serializers and to send to Fireplace. e.g. {'us': 'esrb', 'mx': 'esrb', 'es': 'pegi', 'br': 'classind'}. """ import waffle # Create the mapping. region_to_bodies = {} for region in ALL_REGIONS_WITH_CONTENT_RATINGS(): ratings_body_label = GENERIC_RATING_REGION_SLUG if region.ratingsbody: ratings_body_label = slugify_iarc_name(region.ratingsbody) region_to_bodies[region.slug] = ratings_body_label # Resolve edge cases related to switches. if not waffle.switch_is_active("iarc"): region_to_bodies.update({"de": GENERIC_RATING_REGION_SLUG}) return region_to_bodies
def REGION_TO_RATINGS_BODY(): """ Return a map of region slugs to ratings body labels for use in serializers and to send to Fireplace. e.g. {'us': 'esrb', 'mx': 'esrb', 'es': 'pegi', 'br': 'classind'}. """ import waffle # Create the mapping. region_to_bodies = {} for region in ALL_REGIONS_WITH_CONTENT_RATINGS(): ratings_body_label = GENERIC_RATING_REGION_SLUG if region.ratingsbody: ratings_body_label = slugify_iarc_name(region.ratingsbody) region_to_bodies[region.slug] = ratings_body_label # Resolve edge cases related to switches. if not waffle.switch_is_active('iarc'): region_to_bodies.update({'de': GENERIC_RATING_REGION_SLUG}) return region_to_bodies