fix WordPressURLController rewrite option_value

This commit is contained in:
Jorge Pastor 2023-12-07 17:52:52 +01:00
parent c593385d5c
commit 814696d65e
1 changed files with 2 additions and 1 deletions

View File

@ -18,7 +18,7 @@ class WordPressURLController(ServiceController):
self.append(textwrap.dedent("""\ self.append(textwrap.dedent("""\
mysql %(db_name)s -e 'UPDATE wp_options mysql %(db_name)s -e 'UPDATE wp_options
SET option_value="%(url)s" 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 """) % context
) )
@ -35,6 +35,7 @@ class WordPressURLController(ServiceController):
return { return {
'url': content.get_absolute_url(), 'url': content.get_absolute_url(),
'db_name': content.webapp.data.get('db_name'), 'db_name': content.webapp.data.get('db_name'),
'wp_path': f"http://{content.webapp.get_path()}"
} }