You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After setting up wagtailtinymce as per the instructions in README.md the following happens after trying to run ./manage.py makemigrations (or indeed any other subcommand, I reckon - haven't tested all subcommands).
Here are the last few lines of the stack trace:
File "./venv/local/lib/python2.7/site-packages/wagtailtinymce/rich_text.py", line 66, in __init__
self.kwargs = self.getDefaultArgs()
File "./venv/local/lib/python2.7/site-packages/wagtailtinymce/rich_text.py", line 59, in getDefaultArgs
'language': translation.to_locale(translation.get_language()),
File "./venv/local/lib/python2.7/site-packages/django/utils/translation/__init__.py", line 202, in to_locale
return _trans.to_locale(language)
File "./venv/local/lib/python2.7/site-packages/django/utils/translation/trans_real.py", line 71, in to_locale
p = language.find('-')
AttributeError: 'NoneType' object has no attribute 'find'
After a little investigation, it appears that the language is not set properly in the getDefaultArgs method in class TinyMCERichTextArea in wagtailtinymce/rich_text.py.
To fix, I added an import statement for the project settings before the class is defined:
from django.conf import settings
and then in the definition for getDefaultArgs, I added the following before the return statement:
All seems to work now, but I thought I should share the above and also ask is there a better way to resolve the issue than modifying the source code as above?
The text was updated successfully, but these errors were encountered:
This is not solving this issue but not using tinyMCE as a default (in settings) also seemed to help to get rid of this error when migrating. So this works:
Environment:
After setting up
wagtailtinymce
as per the instructions inREADME.md
the following happens after trying to run./manage.py makemigrations
(or indeed any other subcommand, I reckon - haven't tested all subcommands).Here are the last few lines of the stack trace:
After a little investigation, it appears that the language is not set properly in the
getDefaultArgs
method inclass TinyMCERichTextArea
inwagtailtinymce/rich_text.py
.To fix, I added an import statement for the project settings before the class is defined:
and then in the definition for
getDefaultArgs
, I added the following before the return statement:All seems to work now, but I thought I should share the above and also ask is there a better way to resolve the issue than modifying the source code as above?
The text was updated successfully, but these errors were encountered: