Skip to content

Commit

Permalink
files: add translation to transfer exception message
Browse files Browse the repository at this point in the history
Co-authored-by: David <[email protected]>
  • Loading branch information
zzacharo and rekt-hard committed Oct 2, 2023
1 parent c6e3d28 commit 795885b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions invenio_records_resources/services/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,10 @@ class FailedFileUploadException(Exception):
def __init__(self, recid, file, file_key):
"""Constructor."""
super().__init__(
_("Record '{recid}' failed to upload file '{file_key}'.").format(
recid=recid, file_key=file_key
_(
"Record '{recid}' failed to upload file '{file_key}'.".format(
recid=recid, file_key=file_key
)
)
)
self.recid = recid
Expand Down
2 changes: 1 addition & 1 deletion invenio_records_resources/services/files/transfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def set_file_content(self, record, file, file_key, stream, content_length):
file_key, stream, size=content_length, size_limit=size_limit
)
except (ClientDisconnected, CreateFailed) as e:
raise TransferException(f'Transfer of File with key "{file_key}" failed.')
raise TransferException(_('Transfer of file with key "{file_key}" failed.)'.format(file_key=file_key))

def commit_file(self, record, file_key):
"""Commit a file."""
Expand Down

0 comments on commit 795885b

Please sign in to comment.