From 814696d65eebe02b503db9d993e6aff85bb20a28 Mon Sep 17 00:00:00 2001 From: jorgepastorr Date: Thu, 7 Dec 2023 17:52:52 +0100 Subject: [PATCH] fix WordPressURLController rewrite option_value --- orchestra/contrib/websites/backends/wordpress.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/orchestra/contrib/websites/backends/wordpress.py b/orchestra/contrib/websites/backends/wordpress.py index d138e9b7..36ee2bb7 100644 --- a/orchestra/contrib/websites/backends/wordpress.py +++ b/orchestra/contrib/websites/backends/wordpress.py @@ -18,7 +18,7 @@ class WordPressURLController(ServiceController): self.append(textwrap.dedent("""\ mysql %(db_name)s -e 'UPDATE wp_options SET option_value="%(url)s" - WHERE option_id IN (1, 2) AND option_value="http:";' + WHERE option_id IN (1, 2) AND ( option_value="http:" OR option_value="%(wp_path)s" );' """) % context ) @@ -35,6 +35,7 @@ class WordPressURLController(ServiceController): return { 'url': content.get_absolute_url(), 'db_name': content.webapp.data.get('db_name'), + 'wp_path': f"http://{content.webapp.get_path()}" }