Skip to content

Commit

Permalink
i18n: improve error message formatting for unrecognized field types
Browse files Browse the repository at this point in the history
  • Loading branch information
Samk13 committed Feb 5, 2025
1 parent 0fd57e8 commit f598b6f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions invenio_administration/marshmallow_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ def find_type_in_mapping(field_type, custom_mapping):
return custom_mapping[current_type]
current_type = current_type.__base__

raise KeyError(_("Unrecognized field type: {field_type}", field_type=field_type))
raise KeyError(
_("Unrecognized field type: {field_type}").format(field_type=field_type)
)


def jsonify_schema(schema):
Expand Down Expand Up @@ -161,10 +163,8 @@ def jsonify_schema(schema):
)
except KeyError:
raise Exception(
_(
"Unrecognised schema field {field}: {field_type_name}",
field=field,
field_type_name=field_type_name,
_("Unrecognised schema field {field}: {field_type_name}").format(
field=field, field_type_name=field_type_name
)
)

Expand Down

0 comments on commit f598b6f

Please sign in to comment.