Skip to content

Commit

Permalink
set dataset type before registering pid (which needs the type)
Browse files Browse the repository at this point in the history
  • Loading branch information
qqmyers committed Sep 23, 2024
1 parent 87bd308 commit d265e50
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,6 @@ public Dataset execute(CommandContext ctxt) throws CommandException {
pidProvider.generatePid(theDataset);
}

// Attempt the registration if importing dataset through the API, or the app (but not harvest)
handlePid(theDataset, ctxt);

DatasetType defaultDatasetType = ctxt.datasetTypes().getByName(DatasetType.DEFAULT_DATASET_TYPE);
DatasetType existingDatasetType = theDataset.getDatasetType();
logger.fine("existing dataset type: " + existingDatasetType);
Expand All @@ -130,6 +127,11 @@ public Dataset execute(CommandContext ctxt) throws CommandException {
} else {
theDataset.setDatasetType(defaultDatasetType);
}

// Attempt the registration if importing dataset through the API, or the app (but not harvest)
handlePid(theDataset, ctxt);



ctxt.em().persist(theDataset);

Expand Down

0 comments on commit d265e50

Please sign in to comment.