Commits

Justin Driscoll  committed 032f70d

Added support for functions in cache_dir

  • Participants
  • Parent commits 861930c

Comments (0)

Files changed (1)

File imagekit/specs.py

             {'filename': filename,
              'specname': self.spec.name(),
              'extension': extension.lstrip('.')}
-        return os.path.join(self._obj._ik.cache_dir, filepath, cache_filename)
+        if callable(self._obj._ik.cache_dir):
+            return self._obj._ik.cache_dir(self._obj, filepath,
+                                           cache_filename)
+        else:
+            return os.path.join(self._obj._ik.cache_dir, filepath,
+                                cache_filename)
 
     @property
     def url(self):