From 4fa93f0debe382bda1338657fab59acfa52c4ae5 Mon Sep 17 00:00:00 2001 From: Jeffrey Goettsch Date: Fri, 13 Jun 2014 12:32:29 -0700 Subject: [PATCH] Fixes #139. Properly construct ckeditor_basepath in cms_plugins.py to eliminate the double slashes. --- djangocms_text_ckeditor/cms_plugins.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/djangocms_text_ckeditor/cms_plugins.py b/djangocms_text_ckeditor/cms_plugins.py index a94949a..0b24d1d 100644 --- a/djangocms_text_ckeditor/cms_plugins.py +++ b/djangocms_text_ckeditor/cms_plugins.py @@ -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)