Merge "Simplify setting of urls"

This commit is contained in:
Zuul 2023-09-18 21:16:08 +00:00 committed by Gerrit Code Review
commit ba53673ea1
2 changed files with 3 additions and 28 deletions

View File

@ -47,9 +47,6 @@ describe 'horizon' do
it 'generates local_settings.py' do
verify_concat_fragment_contents(catalogue, 'local_settings.py', [
'DEBUG = False',
"LOGIN_URL = '#{platforms_params[:root_url]}/auth/login/'",
"LOGOUT_URL = '#{platforms_params[:root_url]}/auth/logout/'",
"LOGIN_REDIRECT_URL = '#{platforms_params[:root_url]}/'",
"ALLOWED_HOSTS = ['foo.example.com', ]",
'HORIZON_CONFIG["password_autocomplete"] = "off"',
"SECRET_KEY = secret_key.generate_or_read_from_file('#{platforms_params[:secret_key_file]}')",
@ -723,7 +720,7 @@ describe 'horizon' do
it 'sets WEBROOT in local_settings.py' do
verify_concat_fragment_contents(catalogue, 'local_settings.py', [
"WEBROOT = '/dashboard/'",
"WEBROOT = '/dashboard'",
])
end
end
@ -739,7 +736,7 @@ describe 'horizon' do
it 'sets WEBROOT in local_settings.py' do
verify_concat_fragment_contents(catalogue, 'local_settings.py', [
"WEBROOT = '/horizon/'",
"WEBROOT = '/horizon'",
])
end
end

View File

@ -12,29 +12,7 @@ DEBUG = <%= @django_debug.to_s.capitalize %>
SITE_BRANDING = '<%= @site_branding %>'
<% end -%>
# WEBROOT is the location relative to Webserver root
# should end with a slash.
#LOGIN_URL = WEBROOT + 'auth/login/'
#LOGOUT_URL = WEBROOT + 'auth/logout/'
<% if @root_url == '/' -%>
WEBROOT = '/'
LOGIN_URL = '/auth/login/'
LOGOUT_URL = '/auth/logout/'
<% else -%>
WEBROOT = '<%= @root_url %>/'
LOGIN_URL = '<%= @root_url %>/auth/login/'
LOGOUT_URL = '<%= @root_url %>/auth/logout/'
<% end -%>
# LOGIN_REDIRECT_URL can be used as an alternative for
# HORIZON_CONFIG.user_home, if user_home is not set.
# Do not set it to '/home/', as this will cause circular redirect loop
#LOGIN_REDIRECT_URL = WEBROOT
<% if @root_url == '/' -%>
LOGIN_REDIRECT_URL = '/'
<% else -%>
LOGIN_REDIRECT_URL = '<%= @root_url %>/'
<% end -%>
WEBROOT = '<%= @root_url %>'
# Required for Django 1.5.
# If horizon is running in production (DEBUG is False), set this