mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Fixed bug loading database called 'test-database (1).sqlite'
Closes #1181. Also now ensures that database URLs have special characters URL-quoted.
This commit is contained in:
parent
07e1635615
commit
a5ede3cdd4
7 changed files with 55 additions and 27 deletions
|
|
@ -30,9 +30,11 @@ class Urls:
|
|||
def database(self, database, format=None):
|
||||
db = self.ds.databases[database]
|
||||
if self.ds.setting("hash_urls") and db.hash:
|
||||
path = self.path(f"{database}-{db.hash[:HASH_LENGTH]}", format=format)
|
||||
path = self.path(
|
||||
f"{urllib.parse.quote(database)}-{db.hash[:HASH_LENGTH]}", format=format
|
||||
)
|
||||
else:
|
||||
path = self.path(database, format=format)
|
||||
path = self.path(urllib.parse.quote(database), format=format)
|
||||
return path
|
||||
|
||||
def table(self, database, table, format=None):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue