Compare commits

..

No commits in common. "37524386303eddc49f5b92da1dada034e6f9cc7c" and "1b37aa1522b02e435cc433350e4e4af8932b7ac0" have entirely different histories.

View file

@ -21,7 +21,7 @@ def scope_instances_queryset(user, queryset=None):
if profile.has_role(UserRoles.BROKER): if profile.has_role(UserRoles.BROKER):
return qs.filter(broker=profile.broker) return qs.filter(broker=profile.broker)
if profile.has_role(UserRoles.ACCOUNTANT) or profile.has_role(UserRoles.MANAGER) or profile.has_role(UserRoles.WATER_RESOURCE_MANAGER): if profile.has_role(UserRoles.ACCOUNTANT) or profile.has_role(UserRoles.MANAGER) or profile.has_role(UserRoles.WATER_RESOURCE_MANAGER):
return qs.filter(broker__affairs__county__city=profile.county.city) return qs.filter(broker__affairs__county=profile.county)
if profile.has_role(UserRoles.ADMIN): if profile.has_role(UserRoles.ADMIN):
return qs return qs
# if profile.has_role(UserRoles.WATER_RESOURCE_MANAGER) or profile.has_role(UserRoles.HEADQUARTER): # if profile.has_role(UserRoles.WATER_RESOURCE_MANAGER) or profile.has_role(UserRoles.HEADQUARTER):
@ -70,7 +70,7 @@ def scope_wells_queryset(user, queryset=None):
if profile.has_role(UserRoles.BROKER): if profile.has_role(UserRoles.BROKER):
return qs.filter(broker=profile.broker) return qs.filter(broker=profile.broker)
if profile.has_role(UserRoles.ACCOUNTANT) or profile.has_role(UserRoles.MANAGER) or profile.has_role(UserRoles.WATER_RESOURCE_MANAGER): if profile.has_role(UserRoles.ACCOUNTANT) or profile.has_role(UserRoles.MANAGER) or profile.has_role(UserRoles.WATER_RESOURCE_MANAGER):
return qs.filter(broker__affairs__county__city=profile.county.city) return qs.filter(broker__affairs__county=profile.county)
if profile.has_role(UserRoles.INSTALLER): if profile.has_role(UserRoles.INSTALLER):
# Wells that have instances assigned to this installer # Wells that have instances assigned to this installer
from installations.models import InstallationAssignment from installations.models import InstallationAssignment
@ -103,7 +103,7 @@ def scope_customers_queryset(user, queryset=None):
if profile.has_role(UserRoles.BROKER): if profile.has_role(UserRoles.BROKER):
return qs.filter(broker=profile.broker) return qs.filter(broker=profile.broker)
if profile.has_role(UserRoles.ACCOUNTANT) or profile.has_role(UserRoles.MANAGER) or profile.has_role(UserRoles.WATER_RESOURCE_MANAGER): if profile.has_role(UserRoles.ACCOUNTANT) or profile.has_role(UserRoles.MANAGER) or profile.has_role(UserRoles.WATER_RESOURCE_MANAGER):
return qs.filter(county__city=profile.county.city) return qs.filter(county=profile.county)
if profile.has_role(UserRoles.INSTALLER): if profile.has_role(UserRoles.INSTALLER):
# Customers that are representatives of instances assigned to this installer # Customers that are representatives of instances assigned to this installer
from installations.models import InstallationAssignment from installations.models import InstallationAssignment