Closed DEWaller closed 11 months ago
please provide a full traceback
Environment:
Request Method: POST
Request URL: http://127.0.0.1:8000/admin/localize/submit/snippet/home/headertitle/4/
Django Version: 4.2.3
Python Version: 3.11.1
Installed Applications:
['home',
'menus',
'search',
'streams',
'compressor',
'wagtail.contrib.forms',
'wagtail.contrib.redirects',
'wagtail.embeds',
'wagtail.sites',
'wagtail.users',
'wagtail.snippets',
'wagtail.documents',
'wagtail.images',
'wagtail.search',
'wagtail.admin',
'wagtail_localize',
'wagtail_localize.locales',
'wagtail_localize.modeladmin',
'wagtail',
'modelcluster',
'taggit',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles']
Installed Middleware:
['django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'django.middleware.security.SecurityMiddleware',
'django.middleware.locale.LocaleMiddleware',
'wagtail.contrib.redirects.middleware.RedirectMiddleware']
Traceback (most recent call last):
File "C:\Users\David\Dropbox\Wagtail projects\naturani\env\Lib\site-packages\django\core\handlers\exception.py", line 55, in inner
response = get_response(request)
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\David\Dropbox\Wagtail projects\naturani\env\Lib\site-packages\django\core\handlers\base.py", line 197, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\David\Dropbox\Wagtail projects\naturani\env\Lib\site-packages\django\views\decorators\cache.py", line 62, in _wrapper_view_func
response = view_func(request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\David\Dropbox\Wagtail projects\naturani\env\Lib\site-packages\wagtail\admin\urls\__init__.py", line 180, in wrapper
return view_func(request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\David\Dropbox\Wagtail projects\naturani\env\Lib\site-packages\wagtail\admin\auth.py", line 165, in decorated_view
response = view_func(request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\David\Dropbox\Wagtail projects\naturani\env\Lib\site-packages\django\views\generic\base.py", line 104, in view
return self.dispatch(request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\David\Dropbox\Wagtail projects\naturani\env\Lib\site-packages\wagtail_localize\views\submit_translations.py", line 174, in dispatch
return super().dispatch(request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\David\Dropbox\Wagtail projects\naturani\env\Lib\site-packages\django\views\generic\base.py", line 143, in dispatch
return handler(request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\David\Dropbox\Wagtail projects\naturani\env\Lib\site-packages\wagtail_localize\views\submit_translations.py", line 118, in post
return self.form_valid(form)
^^^^^^^^^^^^^^^^^^^^^
File "C:\Python311\Lib\contextlib.py", line 81, in inner
return func(*args, **kwds)
^^^^^^^^^^^^^^^^^^^
File "C:\Users\David\Dropbox\Wagtail projects\naturani\env\Lib\site-packages\wagtail_localize\views\submit_translations.py", line 125, in form_valid
translate_object(
^
File "C:\Python311\Lib\contextlib.py", line 81, in inner
return func(*args, **kwds)
^^^^^^^^^^^^^^^^^^^
File "C:\Users\David\Dropbox\Wagtail projects\naturani\env\Lib\site-packages\wagtail_localize\operations.py", line 93, in translate_object
translator.create_translations(instance)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\David\Dropbox\Wagtail projects\naturani\env\Lib\site-packages\wagtail_localize\operations.py", line 82, in create_translations
translation.save_target(user=self.user, publish=publish)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\David\Dropbox\Wagtail projects\naturani\env\Lib\site-packages\wagtail_localize\models.py", line 1331, in save_target
self.source.create_or_update_translation(
^
File "C:\Users\David\Dropbox\Wagtail projects\naturani\env\Lib\site-packages\wagtail_localize\models.py", line 739, in create_or_update_translation
raise CannotSaveDraftError
^^^^^^^^^^^^^^^^^^^^^^^^^^
Exception Type: CannotSaveDraftError at /admin/localize/submit/snippet/home/headertitle/4/
Exception Value:
Thank you. Will have a look in the next few days
@DEWaller should be fixed in https://github.com/wagtail/wagtail-localize/releases/tag/v1.6
WAGTAILLOCALIZE_SYNC_LIVE_STATUS_ON_TRANSLATE = False causes a 'CannotSaveDraftError' in \Lib\site-packages\wagtail_localize\models.py, line 739 when translating a snippet.
Django==4.2.5 wagtail==5.1.2 wagtail-localize==1.5.2