diff --git a/app/blueprints/api.py b/app/blueprints/api.py index 01977ae..13412b4 100644 --- a/app/blueprints/api.py +++ b/app/blueprints/api.py @@ -162,6 +162,7 @@ def get_search(): site = Site.find_by_host(host) site_collection_ids = [x.id for x in site.collections] + if filter_collection_id := payload['filter'].get('collection_id'): if isinstance(filter_collection_id, list): available_collection_ids = set(site_collection_ids) & set(filter_collection_id) @@ -169,7 +170,6 @@ def get_search(): available_collection_ids = set(site_collection_ids) & set(filter_collection_id) stmt = stmt.where(Unit.collection_id.in_(available_collection_ids)) - #current_app.logger.debug(stmt) if sd := payload['filter'].get('sourceData'): diff --git a/app/helpers_data.py b/app/helpers_data.py index a42c387..178b7b4 100644 --- a/app/helpers_data.py +++ b/app/helpers_data.py @@ -202,6 +202,6 @@ def import_phase0(data, collection_id): session.add(r) session.commit() - #u = Unit(collection_id=collection_id, record_id=r.id) - #session.add(u) - #session.commit() + u = Unit(collection_id=collection_id, record_id=r.id) + session.add(u) + session.commit()