diff --git a/backend/tracim_backend/models/context_models.py b/backend/tracim_backend/models/context_models.py index 8720ae6c..297bd389 100644 --- a/backend/tracim_backend/models/context_models.py +++ b/backend/tracim_backend/models/context_models.py @@ -730,7 +730,7 @@ def frontend_url(self) -> str: @property def page_nb(self) -> typing.Optional[int]: """ - :return: page_nb of content if available + :return: page_nb of content if available, None if unavailable """ if self.content.depot_file: from tracim_backend.lib.core.content import ContentApi @@ -746,14 +746,14 @@ def page_nb(self) -> typing.Optional[int]: @property def mimetype(self) -> str: """ - :return: mimetype of content if available + :return: mimetype of content if available, None if unavailable """ return self.content.file_mimetype @property def size(self) -> typing.Optional[int]: """ - :return: size of content if available + :return: size of content if available, None if unavailable """ if self.content.depot_file: return self.content.depot_file.file.content_length @@ -918,7 +918,7 @@ def slug(self) -> str: @property def page_nb(self) -> typing.Optional[int]: """ - :return: page_nb of content if available + :return: page_nb of content if available, None if unavailable """ if self.revision.depot_file: # TODO - G.M - 2018-09-05 - Fix circular import better @@ -935,14 +935,14 @@ def page_nb(self) -> typing.Optional[int]: @property def mimetype(self) -> str: """ - :return: mimetype of content if available + :return: mimetype of content if available, None if unavailable """ return self.revision.file_mimetype @property def size(self) -> typing.Optional[int]: """ - :return: size of content if available + :return: size of content if available, None if unavailable """ if self.revision.depot_file: return self.revision.depot_file.file.content_length diff --git a/backend/tracim_backend/views/core_api/schemas.py b/backend/tracim_backend/views/core_api/schemas.py index 2f762815..ee176f52 100644 --- a/backend/tracim_backend/views/core_api/schemas.py +++ b/backend/tracim_backend/views/core_api/schemas.py @@ -831,7 +831,7 @@ class FileInfoAbstractSchema(marshmallow.Schema): description='raw text or html description of the file' ) page_nb = marshmallow.fields.Int( - description='number of pages', + description='number of pages, return null value if unaivalable', example=1, allow_none=True, ) @@ -841,7 +841,7 @@ class FileInfoAbstractSchema(marshmallow.Schema): required=True, ) size = marshmallow.fields.Int( - description='file size in byte', + description='file size in byte, return null value if unaivalable', example=1024, allow_none=True, )