fix news indexing

This commit is contained in:
Kuroshini 2019-12-10 19:29:11 +03:00
parent c1bb7c9b79
commit c90f8302ee
2 changed files with 2 additions and 2 deletions

View File

@ -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]

View File

@ -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)