Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for saving revisions of snippets #751

Closed
wants to merge 9 commits into from
6 changes: 2 additions & 4 deletions wagtail_localize/operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def create_translations(self, instance, include_related_objects=True):
return
self.seen_objects.add(instance.translation_key)

source, created = TranslationSource.get_or_create_from_instance(instance)
source, _ = TranslationSource.get_or_create_from_instance(instance)
mcmeeking marked this conversation as resolved.
Show resolved Hide resolved

# Add related objects
# Must be before translation records or those translation records won't be able to create
Expand Down Expand Up @@ -75,11 +75,9 @@ def create_translations(self, instance, include_related_objects=True):
# Determine whether to publish the translation.
if getattr(settings, "WAGTAILLOCALIZE_SYNC_LIVE_STATUS_ON_TRANSLATE", True):
publish = getattr(instance, "live", True)
elif isinstance(instance, DraftStateMixin):
publish = False
else:
# If the model can't be saved as a draft, then we have to publish it
publish = True
publish = not isinstance(instance, DraftStateMixin)

try:
translation.save_target(user=self.user, publish=publish)
Expand Down