Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Changed a couple of old-style validators to remove some deprecation w…

…arnings

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
  • Loading branch information...
commit 58a68723b3389ec0d92f9372e213e6fc5d868708 1 parent 6dd2b54
@malcolmt malcolmt authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 django/core/validators.py
View
4 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 @@ def __init__(self, min_size=None, max_size=None, min_error_message=None, max_err
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:
Please sign in to comment.
Something went wrong with that request. Please try again.