diff options
| author | Tom Christie | 2012-12-11 21:07:25 +0000 |
|---|---|---|
| committer | Tom Christie | 2012-12-11 21:07:25 +0000 |
| commit | 405822330958c5432dde56b07a61b223c03ca4c7 (patch) | |
| tree | 5f6305d47e82c37f597d4ae533b0a65546ebd7f0 /rest_framework/fields.py | |
| parent | 17b77fc446df29e7708c210eade8369c7babc466 (diff) | |
| download | django-rest-framework-405822330958c5432dde56b07a61b223c03ca4c7.tar.bz2 | |
Fix broken nested fields
Diffstat (limited to 'rest_framework/fields.py')
| -rw-r--r-- | rest_framework/fields.py | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/rest_framework/fields.py b/rest_framework/fields.py index 82745973..75ce1b9f 100644 --- a/rest_framework/fields.py +++ b/rest_framework/fields.py @@ -1056,11 +1056,8 @@ class ImageField(FileField): if f is None: return None - # Try to import PIL in either of the two ways it can end up installed. - try: - from PIL import Image - except ImportError: - import Image + from compat import Image + assert Image is not None, 'PIL must be installed for ImageField support' # We need to get a file object for PIL. We might have a path or we might # have to read the data into memory. |
