From 0f581ab94fcaf3e1f08cd774a8c8a570939d375f Mon Sep 17 00:00:00 2001 From: Evgeny Fadeev Date: Thu, 19 Aug 2010 14:39:57 -0400 Subject: hopefully media urls work on windows. Thanks to adilkhash for the feedback --- askbot/skins/utils.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/askbot/skins/utils.py b/askbot/skins/utils.py index a492c87a..c07f2638 100644 --- a/askbot/skins/utils.py +++ b/askbot/skins/utils.py @@ -53,7 +53,13 @@ def get_media_url(url): file_path ) if os.path.isfile(file_path): - url_copy = os.path.normpath('///' + url_copy) + url_copy = os.path.normpath( + '///' + url_copy + ).replace( + '\\', '/' + ).replace( + '///', '/' + ) return url_copy else: logging.critical('missing media resource %s' % url) @@ -94,7 +100,11 @@ def get_media_url(url): url = use_skin + '/media/' + url url = '///' + django_settings.ASKBOT_URL + 'm/' + url - url = os.path.normpath(url) + url = os.path.normpath(url).replace( + '\\', '/' + ).replace( + '///', '/' + ) if resource_revision: url += '?v=%d' % resource_revision -- cgit v1.2.3-1-g7c22