diff --git a/apps/tag/filters.py b/apps/tag/filters.py index 29b623a9..5b0ba43e 100644 --- a/apps/tag/filters.py +++ b/apps/tag/filters.py @@ -73,10 +73,10 @@ class TagsFilterSet(TagsBaseFilterSet): def by_establishment_type(self, queryset, name, value): if value == EstablishmentType.ARTISAN: - qs = models.Tag.objects.by_category_index_name('shop_category') + qs = models.Tag.objects.filter(index_name__in=settings.ARTISANS_CHOSEN_TAGS) if self.request.country_code and self.request.country_code not in settings.INTERNATIONAL_COUNTRY_CODES: qs = qs.filter(establishments__address__city__country__code=self.request.country_code).distinct('id') - return qs.exclude(establishments__isnull=True)[0:8] + return qs.exclude(establishments__isnull=True) return queryset.by_establishment_type(value) # TMP TODO remove it later diff --git a/project/settings/base.py b/project/settings/base.py index 2dfe1ba1..a7d3274f 100644 --- a/project/settings/base.py +++ b/project/settings/base.py @@ -516,8 +516,12 @@ PHONENUMBER_DEFAULT_REGION = "FR" FALLBACK_LOCALE = 'en-GB' -ESTABLISHMENT_CHOSEN_TAGS = ['gastronomic', 'en_vogue', 'terrace', 'streetfood', 'business', 'bar_cocktail', 'brunch', 'pop'] +ESTABLISHMENT_CHOSEN_TAGS = ['gastronomic', 'terrace', 'streetfood', 'business', 'bar_cocktail', 'brunch', 'pop'] NEWS_CHOSEN_TAGS = ['eat', 'drink', 'cook', 'style', 'international', 'event', 'partnership'] +ARTISANS_CHOSEN_TAGS = ['butchery', 'bakery', 'patisserie', 'cheese_shop', 'fish_shop', 'ice-cream_maker', + 'wine_merchant', 'coffe_shop'] +RECIPES_CHOSEN_TAGS = ['cook', 'eat', 'drink'] + INTERNATIONAL_COUNTRY_CODES = ['www', 'main', 'next'] THUMBNAIL_ENGINE = 'utils.thumbnail_engine.GMEngine'