Fixes #139. Properly construct ckeditor_basepath in cms_plugins.py to eliminate the double slashes.

This commit is contained in:
Jeffrey Goettsch 2014-06-13 12:32:29 -07:00
parent 6990bd4968
commit 4fa93f0deb
1 changed files with 5 additions and 1 deletions

View File

@ -1,6 +1,10 @@
from django.conf import settings
from django.forms.fields import CharField
from django.utils.translation import ugettext_lazy as _
try:
from urlparse import urljoin
except ImportError:
from urllib.parse import urljoin
from cms import __version__ as cms_version
from cms.plugin_base import CMSPluginBase
@ -61,7 +65,7 @@ class TextPlugin(CMSPluginBase):
We override the change form template path
to provide backwards compatibility with CMS 2.x
"""
ckeditor_basepath = '{0}/ckeditor/'.format(settings.STATIC_URL)
ckeditor_basepath = urljoin(settings.STATIC_URL, 'ckeditor/')
if ckeditor_basepath.startswith('//'):
protocol = 'https' if request.is_secure else 'http'
ckeditor_basepath = '{0}:{1}'.format(protocol, ckeditor_basepath)