fix news ES indexing

This commit is contained in:
Kuroshini 2020-01-22 20:23:46 +03:00
parent b7fa52a2ab
commit dd588c039f

View File

@ -71,5 +71,5 @@ class NewsDocument(Document):
The related_models option should be used with caution because it can lead in the index
to the updating of a lot of items.
"""
if isinstance(related_instance, models.NewsType) and hasattr(related_instance, 'news_set'):
return related_instance.news_set.all()
if isinstance(related_instance, models.NewsType) and hasattr(related_instance, 'news'):
return related_instance.news.all()