Fix est_type.id

This commit is contained in:
Виктор Гладких 2019-12-17 17:52:54 +03:00
parent 1d8b707c3c
commit eaefae399d

View File

@ -453,7 +453,7 @@ class IsWineryReviewer(IsStandardUser):
est = EstablishmentSubType.objects.filter(establishment_type_id=request.data['type_id'])
if est.exists():
role = Role.objects.filter(establishment_subtype_id__in=[type.id for type in est],
role = Role.objects.filter(establishment_subtype_id__in=[est_type.id for est_type in est],
role=Role.WINERY_REVIEWER,
country_id__in=[country.id for country in countries]) \
.first()
@ -478,7 +478,7 @@ class IsWineryReviewer(IsStandardUser):
est = EstablishmentSubType.objects.filter(establishment_type_id=type_id)
role = Role.objects.filter(role=Role.WINERY_REVIEWER,
establishment_subtype_id__in=[id for type.id in est],
establishment_subtype_id__in=[est_type.id for est_type in est],
country_id=obj.country_id).first()
object_id: int