Django

Code

Changeset 7837

Show
Ignore:
Timestamp:
07/04/08 21:14:34 (2 months ago)
Author:
mtredinnick
Message:

Changed a couple of old-style validators to remove some deprecation warnings
when using ImageFields?, etc, in the admin interface. Cosmetic only. Refs #7608.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/core/validators.py

    r7258 r7837  
    178178    from cStringIO import StringIO 
    179179    try: 
    180         content = field_data['content'] 
     180        content = field_data.read() 
    181181    except TypeError: 
    182182        raise ValidationError, _("No file was submitted. Check the encoding type on the form.") 
     
    470470    def __call__(self, field_data, all_data): 
    471471        try: 
    472             content = field_data['content'] 
     472            content = field_data.read() 
    473473        except TypeError: 
    474474            raise ValidationError, ugettext_lazy("No file was submitted. Check the encoding type on the form.")