Skip to content

Commit

Permalink
fix: rebuild-index not working
Browse files Browse the repository at this point in the history
* due to index not registered correctly
  • Loading branch information
utnapischtim committed Jan 7, 2024
1 parent 67321f5 commit 7221900
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions invenio_records_lom/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,19 @@ def init(state: BlueprintSetupState):
app = state.app
# Register services - cannot be done in extension because
# Invenio-Records-Resources might not have been initialized.
registry = app.extensions["invenio-records-resources"].registry
ext = app.extensions["invenio-records-lom"]

registry.register(ext.records_service, service_id="lom-records")
registry.register(ext.records_service.files, service_id="lom-files")
registry.register(ext.records_service.draft_files, service_id="lom-draft-files")
registry.register(ext.iiif_service, service_id="lom-iiif")
sregistry = app.extensions["invenio-records-resources"].registry
sregistry.register(ext.records_service, service_id="lom-records")
sregistry.register(ext.records_service.files, service_id="lom-files")
sregistry.register(ext.records_service.draft_files, service_id="lom-draft-files")
sregistry.register(ext.iiif_service, service_id="lom-iiif")

iregistry = app.extensions["invenio-indexer"].registry
iregistry.register(ext.records_service.indexer, indexer_id="lom-records")
iregistry.register(
ext.records_service.draft_indexer, indexer_id="lom-records-drafts"
)


def create_records_bp(app: Flask):
Expand Down

0 comments on commit 7221900

Please sign in to comment.