must of the week mark
This commit is contained in:
parent
0eb6a73e09
commit
5b6db0f974
|
|
@ -255,6 +255,7 @@ class EstablishmentRUDSerializer(model_serializers.EstablishmentBaseSerializer):
|
|||
'status',
|
||||
'status_display',
|
||||
'last_review',
|
||||
'must_of_the_week',
|
||||
]
|
||||
|
||||
def to_representation(self, instance):
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
||||
return Carousel.objects.filter(**kwargs).exists()
|
||||
|
||||
return False
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user