BO news list by country

This commit is contained in:
Kuroshini 2019-12-16 18:43:15 +03:00
parent b25f387c9b
commit e68142bf2e

View File

@ -99,7 +99,10 @@ class NewsBackOfficeLCView(NewsBackOfficeMixinView,
def get_queryset(self):
"""Override get_queryset method."""
return super().get_queryset().with_extended_related()
qs = super().get_queryset().with_extended_related()
if self.request.country_code:
qs = qs.by_country_code(self.request.country_code)
return qs
class NewsBackOfficeGalleryCreateDestroyView(NewsBackOfficeMixinView,