Skip to content

Commit

Permalink
fix logging file (#26)
Browse files Browse the repository at this point in the history
* fix logging file
  • Loading branch information
nsidnev authored Mar 14, 2020
1 parent 7725fe6 commit d7c07c2
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions botx/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def _convert_text_to_logs_format(cls, text: str) -> str:
)

@classmethod
def _convert_file_to_logs_format(cls, file: Optional[File]) -> Optional[File]:
def _convert_file_to_logs_format(cls, file: Optional[File]) -> Optional[dict]:
"""Convert file to a new file that will be showed in logs.
Arguments:
Expand All @@ -205,8 +205,4 @@ def _convert_file_to_logs_format(cls, file: Optional[File]) -> Optional[File]:
Returns:
New file or nothing.
"""
return (
File.from_string("[file content]", filename=file.file_name)
if file
else None
)
return file.copy(update={"data": "[file content]"}).dict() if file else None

0 comments on commit d7c07c2

Please sign in to comment.