Skip to content
This repository has been archived by the owner on Feb 21, 2019. It is now read-only.

Commit

Permalink
explicit return None/null in description/docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
inkhey committed Sep 5, 2018
1 parent bcaed5c commit 70b5d69
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions backend/tracim_backend/models/context_models.py
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions backend/tracim_backend/views/core_api/schemas.py
Expand Up @@ -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,
)
Expand All @@ -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,
)
Expand Down

0 comments on commit 70b5d69

Please sign in to comment.