changeset baa4dc8f7cb3 in modules/marketing_automation:default
details:
https://hg.tryton.org/modules/marketing_automation?cmd=changeset;node=baa4dc8f7cb3
description:
Add __href__ and is_secure, host and http_host to url module
This ease the composition of URL pointing to Tryton route.
issue8767
review264461005
diffstat:
marketing_automation.py | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
diffs (23 lines):
diff -r d4feb2b26fd7 -r baa4dc8f7cb3 marketing_automation.py
--- a/marketing_automation.py Mon Nov 25 21:55:20 2019 +0100
+++ b/marketing_automation.py Tue Nov 26 22:16:00 2019 +0100
@@ -31,7 +31,7 @@
from trytond.sendmail import sendmail_transactional, SMTPDataManager
from trytond.tools import grouped_slice, reduce_ids
from trytond.transaction import Transaction
-from trytond.url import HOSTNAME
+from trytond.url import http_host
from trytond.wsgi import Base64Converter
from .exceptions import DomainError, ConditionError, TemplateError
@@ -44,9 +44,7 @@
'fullpage')
USE_SSL = bool(config.get('ssl', 'certificate'))
-URL_BASE = config.get('marketing', 'automation_base',
- default=urlunsplit(
- ('http' + ('s' if USE_SSL else ''), HOSTNAME, '', '', '')))
+URL_BASE = config.get('marketing', 'automation_base', default=http_host())
URL_OPEN = urljoin(URL_BASE, '/m/empty.gif')