mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Fix for #597
This commit is contained in:
parent
8790acfbf1
commit
1186ca1eac
1 changed files with 8 additions and 8 deletions
|
|
@ -193,14 +193,14 @@ class DataView(BaseView):
|
||||||
async def resolve_db_name(self, request, db_name, **kwargs):
|
async def resolve_db_name(self, request, db_name, **kwargs):
|
||||||
hash = None
|
hash = None
|
||||||
name = None
|
name = None
|
||||||
if "-" in db_name:
|
if db_name not in self.ds.databases and "-" in db_name:
|
||||||
# Might be name-and-hash, or might just be
|
# No matching DB found, maybe it's a name-hash?
|
||||||
# a name with a hyphen in it
|
name_bit, hash_bit = db_name.rsplit("-", 1)
|
||||||
name, hash = db_name.rsplit("-", 1)
|
if name_bit not in self.ds.databases:
|
||||||
if name not in self.ds.databases:
|
raise NotFound("Database not found: {}".format(name))
|
||||||
# Try the whole name
|
else:
|
||||||
name = db_name
|
name = name_bit
|
||||||
hash = None
|
hash = hash_bit
|
||||||
else:
|
else:
|
||||||
name = db_name
|
name = db_name
|
||||||
# Verify the hash
|
# Verify the hash
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue