Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

global: Fixes error messages. #209

Merged
merged 2 commits into from
Aug 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion invenio_vocabularies/contrib/awards/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class AwardSchema(BaseVocabularySchema):
acronym = SanitizedUnicode()

id = SanitizedUnicode(
validate=validate.Length(min=1, error=_("Pid cannot be blank."))
validate=validate.Length(min=1, error=_("PID cannot be blank."))
)

@validates_schema
Expand Down
2 changes: 1 addition & 1 deletion invenio_vocabularies/contrib/funders/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class FunderSchema(BaseVocabularySchema):
)

id = SanitizedUnicode(
validate=validate.Length(min=1, error=_("Pid cannot be blank."))
validate=validate.Length(min=1, error=_("PID cannot be blank."))
)

@validates_schema
Expand Down
6 changes: 5 additions & 1 deletion invenio_vocabularies/contrib/names/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,11 @@ def validate_names(self, data, **kwargs):
can_compose = data.get("family_name") and data.get("given_name")
name = data.get("name")
if not can_compose and not name:
messages = [_("name or family_name and given_name must be present.")]
messages = [
_(
"A name or the family name together with the given name must be present."
)
]
raise ValidationError({"family_name": messages})

@post_load
Expand Down