Skip to content

Commit

Permalink
validation error
Browse files Browse the repository at this point in the history
  • Loading branch information
Alzpeta committed Oct 4, 2024
1 parent f72a10c commit bf1e04e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion oarepo_doi/actions/doi.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def execute(self, identity, uow, *args, **kwargs):
errors = mapping.metadata_check(topic)
if len(errors) > 0:
raise ValidationError(
message=f"Could not assigned doi due to validation error: {errors} "
message=errors
)

super().execute(identity, uow)
4 changes: 2 additions & 2 deletions oarepo_doi/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def create_doi(service, record, data, event=None):

if len(errors) > 0 and event:
raise ValidationError(
message=f"Could not assigned doi due to validation error: {errors} "
message=errors
)
request_metadata = {"data": {"type": "dois", "attributes": {}}}

Expand Down Expand Up @@ -73,7 +73,7 @@ def edit_doi(service, record, event=None):
record["links"] = record_service.links_item_tpl.expand(system_identity, record)
if len(errors) > 0 and event:
raise ValidationError(
message=f"Could not assigned doi due to validation error: {errors} "
message=errors
)
if not service.url.endswith("/"):
url = service.url + "/"
Expand Down
2 changes: 1 addition & 1 deletion oarepo_doi/types/doi.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def can_create(self, identity, data, receiver, topic, creator, *args, **kwargs):
errors = mapping.metadata_check(topic)
if len(errors) > 0:
raise ValidationError(
message=f"Could not assigned doi due to validation error: {errors} "
message=errors
)
super().can_create(identity, data, receiver, topic, creator, *args, **kwargs)

Expand Down

0 comments on commit bf1e04e

Please sign in to comment.