Skip to content
Snippets Groups Projects
Commit 3ae7cff0 authored by konykon's avatar konykon
Browse files

Merge branch 'feature/multicompany-landing-creation' into 'dev'

Bugfix use always instance config for wp auth

See merge request !125
parents d924e217 e20ce9b4
No related branches found
No related tags found
4 merge requests!138Hotfix setup name error,!134Release v14.0.1.1.6,!129Draft: Release v14.0.1.1.5,!125Bugfix use always instance config for wp auth
Pipeline #30041 passed
......@@ -218,13 +218,16 @@ class ResCompany(models.Model):
}
def action_create_wp_landing(self, fields=None):
username = self.wordpress_db_username
password = self.wordpress_db_password
auth = Authenticate(username, password).authenticate()
token = "Bearer %s" % auth["token"]
landing_page_data = self.landing_page_id.to_dict()
landing_page = LandingPage.create(token, landing_page_data)
self.landing_page_id.write({"wp_landing_page_id": landing_page.id})
instance_company = self.env['res.company'].search(
[('hierarchy_level', '=', 'instance')])
if instance_company:
username = instance_company.wordpress_db_username
password = instance_company.wordpress_db_password
auth = Authenticate(username, password).authenticate()
token = "Bearer %s" % auth["token"]
landing_page_data = self.landing_page_id.to_dict()
landing_page = LandingPage.create(token, landing_page_data)
self.landing_page_id.write({"wp_landing_page_id": landing_page.id})
def get_landing_page_form(self):
return {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment