mirror of
https://github.com/jazzband/django-categories.git
synced 2026-03-16 22:30:24 +00:00
Added a version check to support Django 1.1 in a core Django function
This commit is contained in:
parent
8e1c3ac347
commit
586fefed79
1 changed files with 5 additions and 1 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue