diff --git a/boards/forms.py b/boards/forms.py --- a/boards/forms.py +++ b/boards/forms.py @@ -304,7 +304,7 @@ class PostForm(NeboardForm): # Download file, stop if the size exceeds limit size = 0 content = b'' - for chunk in response.iter_content(file_DOWNLOAD_CHUNK_BYTES): + for chunk in response.iter_content(FILE_DOWNLOAD_CHUNK_BYTES): size += len(chunk) self.validate_file_size(size) content += chunk @@ -315,7 +315,7 @@ class PostForm(NeboardForm): filename = 'file.' + content_type.split('/')[1] img_temp = SimpleUploadedFile(filename, content, content_type) - except Exception: + except Exception as e: # Just return no file pass