mirror of
https://git.linux-kernel.at/oliver/ivatar.git
synced 2025-11-11 18:56:23 +00:00
Merge branch 'adapt-old-config' into 'devel'
fix: resolve backward compability in config See merge request oliver/ivatar!209
This commit is contained in:
15
config.py
15
config.py
@@ -255,3 +255,18 @@ TRUSTED_DEFAULT_URLS = [
|
||||
# This MUST BE THE LAST!
|
||||
if os.path.isfile(os.path.join(BASE_DIR, "config_local.py")):
|
||||
from config_local import * # noqa # flake8: noqa # NOQA # pragma: no cover
|
||||
|
||||
def map_legacy_config(trusted_url):
|
||||
"""
|
||||
For backward compability with the legacy configuration
|
||||
for trusting URLs. Adapts them to fit the new config.
|
||||
"""
|
||||
if isinstance(trusted_url, str):
|
||||
return {
|
||||
"url_prefix": trusted_url
|
||||
}
|
||||
|
||||
return trusted_url
|
||||
|
||||
# Backward compability for legacy behavior
|
||||
TRUSTED_DEFAULT_URLS = list(map(map_legacy_config, TRUSTED_DEFAULT_URLS))
|
||||
|
||||
Reference in New Issue
Block a user