diff --git a/fs_attachment/models/ir_attachment.py b/fs_attachment/models/ir_attachment.py index 7bafad546f..d026fc88f8 100644 --- a/fs_attachment/models/ir_attachment.py +++ b/fs_attachment/models/ir_attachment.py @@ -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") @@ -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) @@ -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"]) diff --git a/fs_image/fields.py b/fs_image/fields.py index fe1b813edd..1513f6aad4 100644 --- a/fs_image/fields.py +++ b/fs_image/fields.py @@ -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, )