mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Renamed datasette.config() to .setting(), closes #1107
This commit is contained in:
parent
5a77f7a649
commit
f2e2bfcdd9
10 changed files with 86 additions and 60 deletions
|
|
@ -136,7 +136,7 @@ class DatabaseView(DataView):
|
|||
"show_hidden": request.args.get("_show_hidden"),
|
||||
"editable": True,
|
||||
"metadata": metadata,
|
||||
"allow_download": self.ds.config("allow_download")
|
||||
"allow_download": self.ds.setting("allow_download")
|
||||
and not db.is_mutable
|
||||
and database != ":memory:",
|
||||
},
|
||||
|
|
@ -161,7 +161,7 @@ class DatabaseDownload(DataView):
|
|||
db = self.ds.databases[database]
|
||||
if db.is_memory:
|
||||
raise DatasetteError("Cannot download :memory: database", status=404)
|
||||
if not self.ds.config("allow_download") or db.is_mutable:
|
||||
if not self.ds.setting("allow_download") or db.is_mutable:
|
||||
raise Forbidden("Database download is forbidden")
|
||||
if not db.path:
|
||||
raise DatasetteError("Cannot download database", status=404)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue