Skip to content

Commit d514c9f

Browse files
author
notactuallyfinn
committed
implement more comments
1 parent c699ae2 commit d514c9f

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

src/hermes/commands/deposit/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,5 +154,5 @@ def __call__(self, args: argparse.Namespace) -> None:
154154
except HermesValidationError as e:
155155
self.log.error(f"Error while executing {plugin_name}: {e}")
156156
raise HermesPluginRunError(
157-
f"Something went wrong while running the curate plugin {self.settings.plugin}"
157+
f"Something went wrong while running the deposit plugin {self.settings.plugin}"
158158
) from e

src/hermes/commands/deposit/invenio.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
from hermes.commands.deposit.error import DepositionUnauthorizedError
2121
from hermes.error import MisconfigurationError
2222
from hermes.model.error import HermesValidationError
23+
from hermes.model.types import ld_dict
2324
from hermes.utils import hermes_doi, hermes_user_agent
2425

2526

@@ -209,6 +210,9 @@ def resolve_license_id(self, license_url: Union[str, None]) -> Union[str, None]:
209210
if license_url is None:
210211
return None
211212

213+
if isinstance(license_url, (dict, ld_dict)) and [*license_url.keys()] == ["@id"]:
214+
license_url = license_url["@id"]
215+
212216
if not isinstance(license_url, str):
213217
raise RuntimeError(
214218
"The given license in CodeMeta must be of type str. "

test/hermes_test/commands/deposit/test_invenio_e2e.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def sandbox_auth():
3737
"http://schema.org/familyName": [{"@value": "Test"}],
3838
"http://schema.org/givenName": [{"@value": "Testi"}]
3939
}],
40-
"http://schema.org/license": ["https://spdx.org/licenses/Apache-2.0"]
40+
"http://schema.org/license": [{"@id": "https://spdx.org/licenses/Apache-2.0"}]
4141
}),
4242
{
4343
"upload_type": "software",

0 commit comments

Comments
 (0)