mirror of
https://github.com/simonw/datasette.git
synced 2026-06-09 18:46:57 +02:00
Remove fail_if_plugins_in_metadata, part of #2248
This commit is contained in:
parent
4da581d09b
commit
d4bc2b2dfc
4 changed files with 3 additions and 31 deletions
|
|
@ -1272,21 +1272,6 @@ def pairs_to_nested_config(pairs: typing.List[typing.Tuple[str, typing.Any]]) ->
|
|||
return result
|
||||
|
||||
|
||||
def fail_if_plugins_in_metadata(metadata: dict, filename=None):
|
||||
"""If plugin config is inside metadata, raise an Exception"""
|
||||
if metadata is not None and metadata.get("plugins") is not None:
|
||||
suggested_extension = (
|
||||
".yaml"
|
||||
if filename is not None
|
||||
and (filename.endswith(".yaml") or filename.endswith(".yml"))
|
||||
else ".json"
|
||||
)
|
||||
raise Exception(
|
||||
f'Datasette no longer accepts plugin configuration in --metadata. Move your "plugins" configuration blocks to a separate file - we suggest calling that datasette.{suggested_extension} - and start Datasette with datasette -c datasette.{suggested_extension}. See https://docs.datasette.io/en/latest/configuration.html for more details.'
|
||||
)
|
||||
return metadata
|
||||
|
||||
|
||||
def make_slot_function(name, datasette, request, **kwargs):
|
||||
from datasette.plugins import pm
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue