Fix publish collect

This commit is contained in:
Виктор Гладких 2019-11-01 16:18:33 +03:00
parent e9b0d0f91b
commit c51cfc1aa4

View File

@ -108,7 +108,8 @@ class Command(BaseCommand):
distinct
a.id,
a.collection_id,
a.establishment_id
a.establishment_id,
a.active
from
(
select distinct
@ -160,6 +161,7 @@ class Command(BaseCommand):
if est.exists():
inst = est.first()
collect = Collection.objects.filter(old_id=obj['collection_id'])
collect.update(is_publish=obj['active'])
print(f'COLLECT COUNT {collect.count()}')
inst.collections.add(*list(collect))
# for c in collect: