2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-04-28 11:36:44 +00:00

Url refactor (#8784)

* Cleanup config template

* Small refactor

- Fix for frontend_base_url setting

* Revert base url

* Fix reverse URL lookup
This commit is contained in:
Oliver 2024-12-29 14:54:02 +11:00 committed by GitHub
parent 964984ccac
commit cd0ee7dbab
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 4 additions and 22 deletions

View File

@ -419,20 +419,9 @@ def get_frontend_settings(debug=True):
# Set the base URL
if 'base_url' not in settings:
base_url = get_setting('INVENTREE_PUI_URL_BASE', 'pui_url_base', '')
if base_url:
warnings.warn(
"The 'INVENTREE_PUI_URL_BASE' key is deprecated. Please use 'INVENTREE_FRONTEND_URL_BASE' instead",
DeprecationWarning,
stacklevel=2,
)
else:
base_url = get_setting(
'INVENTREE_FRONTEND_URL_BASE', 'frontend_url_base', 'platform'
)
settings['base_url'] = base_url
settings['base_url'] = get_setting(
'INVENTREE_FRONTEND_URL_BASE', 'frontend_url_base', 'platform'
)
# Set the server list
settings['server_list'] = settings.get('server_list', [])

View File

@ -1387,7 +1387,7 @@ CUSTOMIZE = get_setting(
# Load settings for the frontend interface
FRONTEND_SETTINGS = config.get_frontend_settings(debug=DEBUG)
FRONTEND_URL_BASE = FRONTEND_SETTINGS.get('base_url', 'platform')
FRONTEND_URL_BASE = FRONTEND_SETTINGS['base_url']
if DEBUG:
logger.info('InvenTree running with DEBUG enabled')

View File

@ -211,10 +211,3 @@ ldap:
# hide_password_reset: true
# logo: img/custom_logo.png
# splash: img/custom_splash.jpg
# hide_pui_banner: true
# Set enabled frontends
# Use the environment variable INVENTREE_CLASSIC_FRONTEND
# classic_frontend: True
# Use the environment variable INVENTREE_PLATFORM_FRONTEND
# platform_frontend: True