Closed hpoul closed 1 month ago
@hpoul the check was indeed added way before Wagtail 4.0
considering we're still supporting 2.15, there needs to be a conditional check and the appropriate logic. isinstance(original, DraftStateMixin)
feels like the right move for Wagtail 4.0+. Just need to check other places where we check whether it is a Page
(e.g. there's logic around publishing when syncing translations)
A PR would be most welcome
I'm not sure if I'll be able to provide a PR, for full support for drafts and versioning it would probably require some more changes, like the permission checks in edit_translation
... combined with making it backward compatibility and adding tests, this is probably not a trivial fix after all.. I think i'll just make my model a Page
😂 it feels like there is no chance this will be the last problem i'd encounter when using snippets..
(I'm basically using wagtail as a headless cms for an app, so it would have been nice to get rid of all those web-related properties, but it seems it's more stable to just go with it)
Should be fixed by #751 / v1.9. Please re-open if still an issue
Since Wagtail 4.0 snippets can be saved as draft by using DraftStateMixin. When translating a snippet which is still in draft mode the following exception is raised:
I guess this check was implemented before snippets could be saved as draft, and can be simply removed? 🤔 or using
isinstance(original, DraftStateMixin)
instead ofisinstance(original, Page)
?https://github.com/wagtail/wagtail-localize/blame/abf2853ad7660dde7b9010de36187e618d4d9184/wagtail_localize/models.py#L740-L742