Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Uses ckeditor if it's in INSTALLED_APPS, otherwise the static files...

... are missing.
  • Loading branch information...
commit 6500e495886babc0a9aee6242a71fc5805d901c9 1 parent c46ffe2
@BertrandBordage authored
Showing with 3 additions and 1 deletion.
  1. +3 −1 terms/forms.py
View
4 terms/forms.py
@@ -4,6 +4,7 @@
from .models import Term
from django.utils.translation import ugettext as _
from .settings import AVAILABLE_WIDGETS, TERMS_DEFINITION_WIDGET as WIDGET
+from django.conf import settings
# If WIDGET == 'auto': get the best widget one can import and ignore
# ImportError if it is raised.
@@ -13,7 +14,8 @@
from django.forms import Textarea # 'basic'
if WIDGET in AVAILABLE_WIDGETS[:3:2]:
from tinymce.widgets import TinyMCE as Textarea # 'tinymce'
- if WIDGET in AVAILABLE_WIDGETS[:4:3]:
+ if WIDGET == AVAILABLE_WIDGETS[3] or (WIDGET == AVAILABLE_WIDGETS[0]
+ and 'ckeditor' in settings.INSTALLED_APPS):
from ckeditor.widgets import CKEditorWidget as Textarea # 'ckeditor'
except ImportError as e:
if WIDGET != AVAILABLE_WIDGETS[0]:
Please sign in to comment.
Something went wrong with that request. Please try again.