When a user creates a copy of a wagtail page that uses a translatable snippet orderable, a 500 error regarding translation keys and locale id gets returned. I believe this is being caused by the snippet still using the alias of the original page.
Screenshot of error message:
IntegrityError at /cms/pages/19687/edit/
duplicate key value violates unique constraint "wagtailpages_blogauthors_translation_key_locale_i_d8e610e6_uniq"
DETAIL: Key (translation_key, locale_id)=(1a0a5a33-d4b8-4121-84a4-9b34939910bb, 1) already exists.
Example:
In our application, BlogAuthors is an orderable using a snippet named Profile.
Profile Model Definition:
class Profile(TranslatableMixin, models.Model):
...
BlogAuthors Orderable Definition (Linked to wagtail page):
The orderable relationship is then set as a TranslateableField under the wagtail page:
TranslatableField('authors'),
When creating a copy of a page and attempting to publish it, the 500 error above then gets returned until we publish it with a different author, and then return and publish with the actual desired author.
When a user creates a copy of a wagtail page that uses a translatable snippet orderable, a 500 error regarding translation keys and locale id gets returned. I believe this is being caused by the snippet still using the alias of the original page.
Screenshot of error message:
Example:
In our application,
BlogAuthors
is an orderable using a snippet namedProfile
.Profile Model Definition:
BlogAuthors Orderable Definition (Linked to wagtail page):
The orderable relationship is then set as a TranslateableField under the wagtail page:
TranslatableField('authors'),
When creating a copy of a page and attempting to publish it, the 500 error above then gets returned until we publish it with a different author, and then return and publish with the actual desired author.