Fixed 'datasette plugins' command, with tests - closes #802

This commit is contained in:
Simon Willison 2020-06-05 16:46:37 -07:00
commit f786033a5f
6 changed files with 92 additions and 61 deletions

View file

@ -626,9 +626,9 @@ class Datasette:
},
}
def _plugins(self, request):
def _plugins(self, request=None, all=False):
ps = list(get_plugins())
if not request.args.get("all"):
if all is False or (request is not None and request.args.get("all")):
ps = [p for p in ps if p["name"] not in DEFAULT_PLUGINS]
return [
{