##// END OF EJS Templates
Fixed shadowing of an internal keyword. Fixed empty URL being treated as a file input
neko259 -
r1763:271906c8 default
parent child Browse files
Show More
@@ -298,11 +298,11 class PostForm(NeboardForm):
298 max_file_count = board_settings.get_int(SECTION_FORMS, 'MaxFileCount')
298 max_file_count = board_settings.get_int(SECTION_FORMS, 'MaxFileCount')
299 if len(inputs) > max_file_count:
299 if len(inputs) > max_file_count:
300 raise forms.ValidationError(ERROR_MANY_FILES)
300 raise forms.ValidationError(ERROR_MANY_FILES)
301 for input in inputs:
301 for file_input in inputs:
302 if isinstance(input, UploadedFile):
302 if isinstance(file_input, UploadedFile):
303 files.append(self._clean_file_file(input))
303 files.append(self._clean_file_file(file_input))
304 else:
304 else:
305 files.append(self._clean_file_url(input))
305 files.append(self._clean_file_url(file_input))
306
306
307 return files
307 return files
308
308
@@ -82,9 +82,9 class UrlFileField(forms.MultiValueField
82 for data in data_list:
82 for data in data_list:
83 if type(data) == list:
83 if type(data) == list:
84 all_data += data
84 all_data += data
85 elif type(data) == str:
85 elif type(data) == str and len(data) > 0:
86 input = data.replace('\r\n', '\n')
86 file_input = data.replace('\r\n', '\n')
87 url_list = input.split('\n')
87 url_list = file_input.split('\n')
88 all_data += url_list
88 all_data += url_list
89
89
90 return all_data
90 return all_data
General Comments 0
You need to be logged in to leave comments. Login now