misc: always declare lingo_url if lingo is deployed (#88419)
gitea/wcs/pipeline/head Build queued...
Details
gitea/wcs/pipeline/head Build queued...
Details
This commit is contained in:
parent
083f3cf3dd
commit
3a4b8c9cc7
|
@ -76,6 +76,12 @@ HOBO_JSON = {
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
'service-id': 'lingo',
|
||||||
|
'title': 'Lingo',
|
||||||
|
'base_url': 'http://payment.example.net/',
|
||||||
|
'secret_key': 'aaa',
|
||||||
|
},
|
||||||
],
|
],
|
||||||
'profile': {
|
'profile': {
|
||||||
'fields': [
|
'fields': [
|
||||||
|
@ -293,6 +299,7 @@ def test_configure_site_options(setuptest, alt_tempdir):
|
||||||
assert pub.get_site_option('xxx', 'variables') == 'HELLO WORLD'
|
assert pub.get_site_option('xxx', 'variables') == 'HELLO WORLD'
|
||||||
assert pub.get_site_option('portal_agent_url', 'variables') == 'http://agents.example.net/'
|
assert pub.get_site_option('portal_agent_url', 'variables') == 'http://agents.example.net/'
|
||||||
assert pub.get_site_option('portal_url', 'variables') == 'http://portal.example.net/'
|
assert pub.get_site_option('portal_url', 'variables') == 'http://portal.example.net/'
|
||||||
|
assert pub.get_site_option('lingo_url', 'variables') == 'http://payment.example.net/'
|
||||||
assert pub.get_site_option('test_wcs_url', 'variables') == 'http://wcs.example.net/'
|
assert pub.get_site_option('test_wcs_url', 'variables') == 'http://wcs.example.net/'
|
||||||
assert pub.get_site_option('disable_cron_jobs', 'variables') == 'True'
|
assert pub.get_site_option('disable_cron_jobs', 'variables') == 'True'
|
||||||
assert pub.get_site_option('maintenance_page', 'variables') == 'True'
|
assert pub.get_site_option('maintenance_page', 'variables') == 'True'
|
||||||
|
|
|
@ -495,6 +495,10 @@ class Command(TenantCommand):
|
||||||
variables['portal_user_url'] = service_url
|
variables['portal_user_url'] = service_url
|
||||||
variables['portal_user_title'] = service.get('title')
|
variables['portal_user_title'] = service.get('title')
|
||||||
config.set('options', 'theme_skeleton_url', service.get('base_url') + '__skeleton__/')
|
config.set('options', 'theme_skeleton_url', service.get('base_url') + '__skeleton__/')
|
||||||
|
|
||||||
|
if service.get('service-id') == 'lingo':
|
||||||
|
variables['lingo_url'] = urllib.parse.urljoin(service_url, '/')
|
||||||
|
|
||||||
for legacy_url in service.get('legacy_urls', []):
|
for legacy_url in service.get('legacy_urls', []):
|
||||||
legacy_domain = urllib.parse.urlparse(legacy_url['base_url']).netloc.split(':')[0]
|
legacy_domain = urllib.parse.urlparse(legacy_url['base_url']).netloc.split(':')[0]
|
||||||
legacy_urls[legacy_domain] = domain
|
legacy_urls[legacy_domain] = domain
|
||||||
|
|
Loading…
Reference in New Issue