replaced checking is_staff on is_superuser

This commit is contained in:
Anatoly 2020-01-30 14:33:00 +03:00
parent d6b8c6191d
commit 469a80339a
3 changed files with 3 additions and 3 deletions

View File

@ -523,7 +523,7 @@ class EstablishmentQuerySet(models.QuerySet):
"""Return QuerySet with establishments that user has an access."""
from account.models import UserRole
if not user.is_staff:
if not user.is_superuser:
filters = {'address__city__country__code': country_code}
if user.is_establishment_administrator and not user.is_establishment_manager:
filters.update({

View File

@ -246,7 +246,7 @@ class NewsQuerySet(TranslationQuerysetMixin):
def available_news(self, user, country_code: str):
"""Return QuerySet with news that user has an access."""
return self.filter(site__country__code=country_code) if not user.is_staff else self
return self.filter(site__country__code=country_code) if not user.is_superuser else self
class News(GalleryMixin, BaseAttributes, TranslatedFieldsMixin, HasTagsMixin,

View File

@ -231,7 +231,7 @@ class ProductQuerySet(models.QuerySet):
"""Return QuerySet with products that user has an access."""
from account.models import UserRole
if not user.is_staff:
if not user.is_superuser:
filters = {'establishment__address__city__country__code': country_code}
if user.is_establishment_administrator and not user.is_establishment_manager:
filters.update({