diff --git a/core/graphene/object_types.py b/core/graphene/object_types.py index 9bfedf9a..1106fd63 100644 --- a/core/graphene/object_types.py +++ b/core/graphene/object_types.py @@ -68,7 +68,7 @@ class SEOMetaType(ObjectType): open_graph = GenericScalar() twitter = GenericScalar() json_ld = List(GenericScalar) - hreflang = List(GenericScalar) + hreflang = String() class AttributeType(DjangoObjectType): @@ -173,7 +173,7 @@ class BrandType(DjangoObjectType): "open_graph": og, "twitter": tw, "json_ld": json_ld, - "hreflang": [], + "hreflang": info.context.LANGUAGE_CODE, } @@ -336,7 +336,7 @@ class CategoryType(DjangoObjectType): "open_graph": og, "twitter": tw, "json_ld": json_ld, - "hreflang": [], + "hreflang": info.context.LANGUAGE_CODE, } @@ -590,7 +590,7 @@ class ProductType(DjangoObjectType): "open_graph": og, "twitter": tw, "json_ld": json_ld, - "hreflang": [], + "hreflang": info.context.LANGUAGE_CODE, } diff --git a/core/serializers/seo.py b/core/serializers/seo.py index 780d25a5..046fa1c7 100644 --- a/core/serializers/seo.py +++ b/core/serializers/seo.py @@ -7,7 +7,7 @@ class SeoSnapshotSerializer(Serializer): description = CharField() canonical = CharField() robots = CharField() - hreflang = ListField(child=DictField(), required=False) + hreflang = CharField() open_graph = DictField() twitter = DictField() json_ld = ListField(child=DictField()) diff --git a/core/viewsets.py b/core/viewsets.py index df27c738..cc802cc8 100644 --- a/core/viewsets.py +++ b/core/viewsets.py @@ -369,6 +369,7 @@ class CategoryViewSet(EvibesViewSet): "description": description, "canonical": canonical, "robots": "index,follow", + "hreflang": request.LANGUAGE_CODE, "open_graph": og, "twitter": tw, "json_ld": json_ld, @@ -492,6 +493,7 @@ class BrandViewSet(EvibesViewSet): "description": description, "canonical": canonical, "robots": "index,follow", + "hreflang": request.LANGUAGE_CODE, "open_graph": og, "twitter": tw, "json_ld": json_ld, @@ -618,6 +620,7 @@ class ProductViewSet(EvibesViewSet): "description": description, "canonical": canonical, "robots": "index,follow", + "hreflang": request.LANGUAGE_CODE, "open_graph": og, "twitter": tw, "json_ld": json_ld,