From 586fefed7918b7edea955801e8460fff6990f3ae Mon Sep 17 00:00:00 2001 From: Corey Oordt Date: Fri, 14 Oct 2011 13:50:11 -0400 Subject: [PATCH] Added a version check to support Django 1.1 in a core Django function --- categories/models.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/categories/models.py b/categories/models.py index a1d86c9..c65dd98 100644 --- a/categories/models.py +++ b/categories/models.py @@ -94,7 +94,11 @@ class Category(MPTTModel): self.slug = slugify(self.name)[:50] if self.thumbnail: from django.core.files.images import get_image_dimensions - width, height = get_image_dimensions(self.thumbnail.file, close=True) + import django + if django.VERSION[1] < 2: + width, height = get_image_dimensions(self.thumbnail.file) + else: + width, height = get_image_dimensions(self.thumbnail.file, close=True) else: width, height = None, None