From 6cd211704e99e484d748b40fbd8c324e6bdb991c Mon Sep 17 00:00:00 2001 From: Nick Moreton Date: Sun, 21 May 2023 13:27:00 +0100 Subject: [PATCH] Don't set a page to live if it is not already live --- wagtail_qrcode/wagtail_hooks.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wagtail_qrcode/wagtail_hooks.py b/wagtail_qrcode/wagtail_hooks.py index 31ac0cb..62cc567 100644 --- a/wagtail_qrcode/wagtail_hooks.py +++ b/wagtail_qrcode/wagtail_hooks.py @@ -24,7 +24,9 @@ def generate_qr_code(request, page): page.qr_code_eps = document rev = page.save_revision() - rev.publish() + + if page.live: + rev.publish() def send_qr_code_email(page, email=None, subject=None, body=None):