kopia lustrzana https://github.com/simonw/datasette
Applied blacken-docs
rodzic
dbfad6d220
commit
ab040470e2
|
@ -1450,13 +1450,18 @@ This example adds a new database action for creating a table, if the user has th
|
||||||
def database_actions(datasette, actor, database):
|
def database_actions(datasette, actor, database):
|
||||||
async def inner():
|
async def inner():
|
||||||
if not await datasette.permission_allowed(
|
if not await datasette.permission_allowed(
|
||||||
actor, "edit-schema", resource=database, default=False
|
actor,
|
||||||
|
"edit-schema",
|
||||||
|
resource=database,
|
||||||
|
default=False,
|
||||||
):
|
):
|
||||||
return []
|
return []
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
"href": datasette.urls.path(
|
"href": datasette.urls.path(
|
||||||
"/-/edit-schema/{}/-/create".format(database)
|
"/-/edit-schema/{}/-/create".format(
|
||||||
|
database
|
||||||
|
)
|
||||||
),
|
),
|
||||||
"label": "Create a table",
|
"label": "Create a table",
|
||||||
}
|
}
|
||||||
|
|
Ładowanie…
Reference in New Issue