fix filter old_estab

This commit is contained in:
Dmitriy Kuzmenko 2019-11-02 10:11:47 +03:00
parent 4059446a3c
commit 20b9b9affd

View File

@ -17,7 +17,7 @@ def transfer_establishment():
old_establishments = Establishments.objects.exclude( old_establishments = Establishments.objects.exclude(
Q(type='Wineyard') | Q(type='Wineyard') |
Q(location__timezone__isnull=True), Q(location__timezone__isnull=True),
id__in=Establishment.objects.all().values_list('old_id', flat=True) id__in=list(Establishment.objects.all().values_list('old_id', flat=True))
).prefetch_related( ).prefetch_related(
'establishmentinfos_set', 'establishmentinfos_set',
'schedules_set', 'schedules_set',