diff --git a/apps/establishment/serializers/back.py b/apps/establishment/serializers/back.py index 3c218ed0..cbedea4b 100644 --- a/apps/establishment/serializers/back.py +++ b/apps/establishment/serializers/back.py @@ -255,6 +255,7 @@ class EstablishmentRUDSerializer(model_serializers.EstablishmentBaseSerializer): 'status', 'status_display', 'last_review', + 'must_of_the_week', ] def to_representation(self, instance): diff --git a/apps/utils/models.py b/apps/utils/models.py index 06a1bf99..e61651b2 100644 --- a/apps/utils/models.py +++ b/apps/utils/models.py @@ -518,6 +518,7 @@ def default_menu_bool_array(): class PhoneModelMixin: """Mixin for PhoneNumberField.""" + @cached_property def country_calling_code(self): """Return phone code from PhonеNumberField.""" @@ -546,10 +547,13 @@ class CarouselMixin: """Detects whether current item in carousel""" from main.models import Carousel - if hasattr(self, 'pk') and hasattr(self, 'country'): + if hasattr(self, 'pk') and (hasattr(self, 'country') or hasattr(self, 'country_id')): kwargs = { 'content_type': ContentType.objects.get_for_model(self), 'object_id': self.pk, - 'country': self.country, + 'country': getattr(self, 'country', getattr(self, 'country_id', None)), } - return Carousel.objects.filter(**kwargs).exists() \ No newline at end of file + + return Carousel.objects.filter(**kwargs).exists() + + return False