summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2008-07-05 02:14:34 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2008-07-05 02:14:34 +0000
commit58a68723b3389ec0d92f9372e213e6fc5d868708 (patch)
treef2972ae76a087685cb1f176d29c4d3fb8b77ac4f
parent6dd2b5468fa275d53aa60fdcaff8c28bdc5e9c25 (diff)
Changed a couple of old-style validators to remove some deprecation warnings
when using ImageFields, etc, in the admin interface. Cosmetic only. Refs #7608. git-svn-id: http://code.djangoproject.com/svn/django/trunk@7837 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r--django/core/validators.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/django/core/validators.py b/django/core/validators.py
index e728dbc0ed..3ef0adeda6 100644
--- a/django/core/validators.py
+++ b/django/core/validators.py
@@ -177,7 +177,7 @@ def isValidImage(field_data, all_data):
from PIL import Image
from cStringIO import StringIO
try:
- content = field_data['content']
+ content = field_data.read()
except TypeError:
raise ValidationError, _("No file was submitted. Check the encoding type on the form.")
try:
@@ -469,7 +469,7 @@ class HasAllowableSize(object):
def __call__(self, field_data, all_data):
try:
- content = field_data['content']
+ content = field_data.read()
except TypeError:
raise ValidationError, ugettext_lazy("No file was submitted. Check the encoding type on the form.")
if self.min_size is not None and len(content) < self.min_size: