diff --git a/apps/news/models.py b/apps/news/models.py index 7931b17b..f54378b6 100644 --- a/apps/news/models.py +++ b/apps/news/models.py @@ -232,7 +232,7 @@ class News(GalleryModelMixin, BaseAttributes, TranslatedFieldsMixin, HasTagsMixi @property def web_url(self): - return reverse('web:news:rud', kwargs={'slug': self.slug}) + return reverse('web:news:rud', kwargs={'slug': next(iter(self.slugs.values()))}) def should_read(self, user): return self.__class__.objects.should_read(self, user)[:3] diff --git a/apps/search_indexes/documents/news.py b/apps/search_indexes/documents/news.py index f48494fd..05e8c2bb 100644 --- a/apps/search_indexes/documents/news.py +++ b/apps/search_indexes/documents/news.py @@ -17,7 +17,7 @@ class NewsDocument(Document): 'name': fields.KeywordField()}) title = fields.ObjectField(attr='title_indexing', properties=OBJECT_FIELD_PROPERTIES) - slugs = fields.ObjectField(properties=OBJECT_FIELD_PROPERTIES) + slugs = fields.ObjectField() backoffice_title = fields.TextField(analyzer='english') subtitle = fields.ObjectField(attr='subtitle_indexing', properties=OBJECT_FIELD_PROPERTIES)