Skip to content

Commit

Permalink
[FIX] pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
lmignon committed May 2, 2024
1 parent 1302dc3 commit e886c85
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
10 changes: 7 additions & 3 deletions fs_attachment/models/ir_attachment.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,8 @@ def write(self, vals):
# nor the mimetype, so the mimetype will be set to ``application/octet-
# stream``.
# We want to avoid this, so we take the mimetype of the first attachment
# and we set it on all the attachments if they all have the same mimetype.
# and we set it on all the attachments if they all have the same
# mimetype.
# If they don't have the same mimetype, we raise an error.
# OPW-3277070
mimetypes = self.mapped("mimetype")
Expand Down Expand Up @@ -560,7 +561,9 @@ def _fs_mark_for_gc(self, fname):
def _get_fs_parts(
self,
) -> tuple[fsspec.AbstractFileSystem, str, str] | tuple[None, None, None]:
"""Return the filesystem, the storage code and the path for the current attachment"""
"""Return the filesystem, the storage code and the path for the
current attachment
"""
if not self.store_fname:
return None, None, None
return self._fs_parse_store_fname(self.store_fname)
Expand Down Expand Up @@ -1069,7 +1072,8 @@ def _get_attachment_data(self) -> dict:
file_path = file_path.lstrip("/")
ret["checksum"] = self._filesystem.checksum(file_path)
ret["file_size"] = self._filesystem.size(file_path)
# TODO index_content is too expensive to compute here or should be configurable
# TODO index_content is too expensive to compute here or should be
# configurable
# data = self._file.read()
# ret["index_content"] = self.attachment._index_content(data,
# self.attachment.mimetype, ret["checksum"])
Expand Down
3 changes: 2 additions & 1 deletion fs_image/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,8 @@ def _update_alt_text(self, records, value: dict):
if not record[self.name]:
raise UserError(
_(
"Cannot set alt_text on empty image (record %(record)s.%(field_name)s)",
"Cannot set alt_text on empty image "
"(record %(record)s.%(field_name)s)",
record=record,
field_name=self.name,
)
Expand Down

0 comments on commit e886c85

Please sign in to comment.