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,