Skip to content

Commit 0251cd1

Browse files
author
notactuallyfinn
committed
potentially fixed error where multiple record ids are halucinated.
1 parent 180cc10 commit 0251cd1

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/hermes/commands/deposit/invenio.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -327,11 +327,11 @@ def prepare(self) -> None:
327327
tmp_rec_id, tmp_rec_meta = self.resolver.resolve_latest_id(
328328
record_id=conf_rec_id, doi=conf_doi, codemeta_identifier=codemeta_identifier
329329
)
330-
if tmp_rec_id is not None or tmp_rec_meta != {}:
331-
if rec_id != tmp_rec_id or rec_meta != tmp_rec_meta:
332-
# FIXME: Maybe finding different record ids is not fatal?
333-
raise HermesValidationError("Found two different record ids or conflicting metadata.")
330+
if rec_id is None and rec_meta == {}:
334331
rec_id, rec_meta = tmp_rec_id, tmp_rec_meta
332+
elif (tmp_rec_id is not None or tmp_rec_meta != {}) and(rec_id != tmp_rec_id or rec_meta != tmp_rec_meta):
333+
# FIXME: Maybe finding different record ids is not fatal?
334+
raise HermesValidationError("Found two different record ids or conflicting metadata.")
335335

336336
if len(self.metadata.get("version", [])) > 1:
337337
raise HermesValidationError("Too many licenses for invenio deposit.")

0 commit comments

Comments
 (0)