Show More
@@ -298,11 +298,11 class PostForm(NeboardForm): | |||
|
298 | 298 | max_file_count = board_settings.get_int(SECTION_FORMS, 'MaxFileCount') |
|
299 | 299 | if len(inputs) > max_file_count: |
|
300 | 300 | raise forms.ValidationError(ERROR_MANY_FILES) |
|
301 | for input in inputs: | |
|
302 | if isinstance(input, UploadedFile): | |
|
303 | files.append(self._clean_file_file(input)) | |
|
301 | for file_input in inputs: | |
|
302 | if isinstance(file_input, UploadedFile): | |
|
303 | files.append(self._clean_file_file(file_input)) | |
|
304 | 304 | else: |
|
305 | files.append(self._clean_file_url(input)) | |
|
305 | files.append(self._clean_file_url(file_input)) | |
|
306 | 306 | |
|
307 | 307 | return files |
|
308 | 308 |
@@ -82,9 +82,9 class UrlFileField(forms.MultiValueField | |||
|
82 | 82 | for data in data_list: |
|
83 | 83 | if type(data) == list: |
|
84 | 84 | all_data += data |
|
85 | elif type(data) == str: | |
|
86 | input = data.replace('\r\n', '\n') | |
|
87 | url_list = input.split('\n') | |
|
85 | elif type(data) == str and len(data) > 0: | |
|
86 | file_input = data.replace('\r\n', '\n') | |
|
87 | url_list = file_input.split('\n') | |
|
88 | 88 | all_data += url_list |
|
89 | 89 | |
|
90 | 90 | return all_data |
General Comments 0
You need to be logged in to leave comments.
Login now