From c51cfc1aa4a929b9797352f8507ff61851bfc83c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D0=B8=D0=BA=D1=82=D0=BE=D1=80=20=D0=93=D0=BB=D0=B0?= =?UTF-8?q?=D0=B4=D0=BA=D0=B8=D1=85?= Date: Fri, 1 Nov 2019 16:18:33 +0300 Subject: [PATCH] Fix publish collect --- apps/collection/management/commands/import_collection.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/collection/management/commands/import_collection.py b/apps/collection/management/commands/import_collection.py index 0e8fa8d3..45f8ddb8 100644 --- a/apps/collection/management/commands/import_collection.py +++ b/apps/collection/management/commands/import_collection.py @@ -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: