Skip to content

Commit

Permalink
models: fix imports of migraiton models
Browse files Browse the repository at this point in the history
  • Loading branch information
zzacharo committed Nov 6, 2024
1 parent f5d7bf0 commit bb0d7c6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cds_migrator_kit/rdm/migration/affiliations/load.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from invenio_rdm_migrator.load.base import Load
from sqlalchemy.exc import IntegrityError

from cds_rdm.models import CDSMigrationAffiliationMapping
from cds_rdm.legacy.models import CDSMigrationAffiliationMapping

from .log import AffiliationsLogger

Expand Down
2 changes: 1 addition & 1 deletion cds_migrator_kit/rdm/migration/load/load.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

from cds_migrator_kit.records.log import RDMJsonLogger
from cds_rdm.minters import legacy_recid_minter
from cds_rdm.models import CDSMigrationLegacyRecord
from cds_rdm.legacy.models import CDSMigrationLegacyRecord

cli_logger = logging.getLogger("migrator")

Expand Down
6 changes: 5 additions & 1 deletion cds_migrator_kit/rdm/migration/transform/transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
RecordFlaggedCuration,
)
from cds_migrator_kit.records.log import RDMJsonLogger
from cds_rdm.models import CDSMigrationAffiliationMapping
from cds_rdm.legacy.models import CDSMigrationAffiliationMapping
from invenio_access.permissions import system_identity
from invenio_search.engine import dsl
from invenio_records_resources.proxies import current_service_registry
Expand Down Expand Up @@ -382,6 +382,7 @@ def field_accelerators(record_json, custom_fields_dict):
"cern:projects": [],
"cern:facilities": [],
"cern:studies": [],
"cern:beams": [],
}
try:
field_experiments(json_entry, custom_fields)
Expand All @@ -401,6 +402,9 @@ def field_accelerators(record_json, custom_fields_dict):
custom_fields["cern:studies"] = json_entry.get("custom_fields", {}).get(
"cern:studies", []
)
custom_fields["cern:beams"] = json_entry.get("custom_fields", {}).get(
"cern:beams", []
)
return custom_fields

def transform(self, entry):
Expand Down

0 comments on commit bb0d7c6

Please sign in to comment.