From 0c341d780ebcde0e81c81eda07e2db3aaa92549b Mon Sep 17 00:00:00 2001 From: Joseph Kocherhans Date: Fri, 2 Jun 2006 03:51:30 +0000 Subject: multi-auth: Merged to [3051] git-svn-id: http://code.djangoproject.com/svn/django/branches/multi-auth@3052 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/forms/__init__.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'django/forms/__init__.py') diff --git a/django/forms/__init__.py b/django/forms/__init__.py index 7ad26a4d71..b67e1d0f84 100644 --- a/django/forms/__init__.py +++ b/django/forms/__init__.py @@ -577,7 +577,7 @@ class SelectMultipleField(SelectField): selected_html = '' if str(value) in str_data_list: selected_html = ' selected="selected"' - output.append(' ' % (escape(value), selected_html, choice)) + output.append(' ' % (escape(value), selected_html, escape(choice))) output.append(' ') return '\n'.join(output) @@ -641,7 +641,11 @@ class FileUploadField(FormField): self.validator_list = [self.isNonEmptyFile] + validator_list def isNonEmptyFile(self, field_data, all_data): - if not field_data['content']: + try: + content = field_data['content'] + except TypeError: + raise validators.CriticalValidationError, gettext("No file was submitted. Check the encoding type on the form.") + if not content: raise validators.CriticalValidationError, gettext("The submitted file is empty.") def render(self, data): -- cgit v1.3