replaced checking is_staff on is_superuser
This commit is contained in:
parent
d6b8c6191d
commit
469a80339a
|
|
@ -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({
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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({
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user