summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeffrey Goettsch <jeff@primal.ucdavis.edu>2014-06-13 19:32:29 (GMT)
committerJeffrey Goettsch <jeff@primal.ucdavis.edu>2014-06-13 19:32:29 (GMT)
commit4fa93f0debe382bda1338657fab59acfa52c4ae5 (patch)
tree60aa9efc0a52d336da9bb845e84aa9defc2a6210
parent6990bd49684cf918a715182423e27ec3d141619d (diff)
downloaddjangocms-text-ckeditor-4fa93f0debe382bda1338657fab59acfa52c4ae5.zip
djangocms-text-ckeditor-4fa93f0debe382bda1338657fab59acfa52c4ae5.tar.gz
djangocms-text-ckeditor-4fa93f0debe382bda1338657fab59acfa52c4ae5.tar.bz2
Fixes #139. Properly construct ckeditor_basepath in cms_plugins.py to eliminate the double slashes.
-rw-r--r--djangocms_text_ckeditor/cms_plugins.py6
1 files changed, 5 insertions, 1 deletions
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)