Skip to content

Commit

Permalink
fix: helpers.import_phase0 need to add unit
Browse files Browse the repository at this point in the history
  • Loading branch information
moogoo78 committed Jun 25, 2024
1 parent e159a27 commit 761c5e3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/blueprints/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,14 +162,14 @@ 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)
elif int(filter_collection_ids) in site_collection_ids:
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'):
Expand Down
6 changes: 3 additions & 3 deletions app/helpers_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

0 comments on commit 761c5e3

Please sign in to comment.