From 98d50f1e93842b6e70c3f9bd6693799fe03fe17e Mon Sep 17 00:00:00 2001 From: Andrey Date: Thu, 14 Dec 2017 18:07:34 +0300 Subject: [PATCH] fix --- storage/api.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/storage/api.py b/storage/api.py index 81ea7fa..d0e0f60 100644 --- a/storage/api.py +++ b/storage/api.py @@ -17,13 +17,16 @@ def upload_file(original=None, name=None, base64=None) -> File: return new_file -def add_comment(text: str, email: str, files=[]) -> Comment: +def add_comment(text: str, email: str, files=None) -> Comment: """ :param text: sting :param email: string :param files: {name?: string, original?: File, base64?: string}[] одно из двух последних свойств должно быть указано :return: Comment """ + + files = [] if files is None else files + key = ''.join(random.choice(string.ascii_letters) for _x in range(15)) comment = Comment.objects.create( text=text,