summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaren Tracey <kmtracey@gmail.com>2011-12-25 19:44:20 +0000
committerKaren Tracey <kmtracey@gmail.com>2011-12-25 19:44:20 +0000
commitb04578372930431827019a821ff946b36db3256d (patch)
tree595bba72bc1d00cc760f5225d0a6ce921eaf89b4
parent5df784ab4293fb6740d062fe868be7bcafed348a (diff)
Fixed #17462: Adjusted staticfiles CachedFilesMixin code so its tests pass on Windows.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17276 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r--django/contrib/staticfiles/storage.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/django/contrib/staticfiles/storage.py b/django/contrib/staticfiles/storage.py
index 8353889e82..c0cc100ca8 100644
--- a/django/contrib/staticfiles/storage.py
+++ b/django/contrib/staticfiles/storage.py
@@ -102,7 +102,7 @@ class CachedFilesMixin(object):
cache_key = self.cache_key(name)
hashed_name = self.cache.get(cache_key)
if hashed_name is None:
- hashed_name = self.hashed_name(name)
+ hashed_name = self.hashed_name(name).replace('\\', '/')
# set the cache if there was a miss (e.g. if cache server goes down)
self.cache.set(cache_key, hashed_name)
return unquote(super(CachedFilesMixin, self).url(hashed_name))
@@ -121,7 +121,7 @@ class CachedFilesMixin(object):
# Completely ignore http(s) prefixed URLs
if url.startswith(('http', 'https')):
return matched
- name_parts = name.split('/')
+ name_parts = name.split(os.sep)
# Using posix normpath here to remove duplicates
url = posixpath.normpath(url)
url_parts = url.split('/')