fix filter old_estab

This commit is contained in:
Dmitriy Kuzmenko 2019-11-02 10:24:24 +03:00
parent 20b9b9affd
commit 1747f6e95c

View File

@ -15,9 +15,10 @@ def transfer_establishment():
# todo: filter(location__city__name__icontains='paris')
old_establishments = Establishments.objects.exclude(
id__in=list(Establishment.objects.all().values_list('old_id', flat=True))
).exclude(
Q(type='Wineyard') |
Q(location__timezone__isnull=True),
id__in=list(Establishment.objects.all().values_list('old_id', flat=True))
).prefetch_related(
'establishmentinfos_set',
'schedules_set',