# HG changeset patch # User neko259 # Date 2015-08-18 09:36:21 # Node ID d07d5464ebd848101a7dc4a61bf9fe9bb2490f40 # Parent ec03da5d4835a45fcb2fbf5a8b405dc4a0f55c97 Fixed upload from url 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