Settings fix, refs #1433

pull/1433/head
Simon Willison 2021-08-12 20:54:25 -07:00 zatwierdzone przez GitHub
rodzic ca4f83dc7b
commit bbc4756f9e
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -277,7 +277,7 @@ class Datasette:
self.static_mounts = static_mounts or []
if config_dir and (config_dir / "config.json").exists():
raise StartupError("config.json should be renamed to settings.json")
if config_dir and (config_dir / "settings.json").exists() and not config:
if config_dir and (config_dir / "settings.json").exists() and not settings:
config = json.loads((config_dir / "settings.json").read_text())
self._settings = dict(DEFAULT_SETTINGS, **(settings or {}))
self.renderers = {} # File extension -> (renderer, can_render) functions