mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Fix for RowNotFound, refs #2359
This commit is contained in:
parent
7316dd4ac6
commit
263788906a
2 changed files with 3 additions and 5 deletions
|
|
@ -1638,9 +1638,7 @@ class Datasette:
|
|||
results = await db.execute(sql, params, truncate=True)
|
||||
row = results.first()
|
||||
if row is None:
|
||||
raise RowNotFound(
|
||||
"Row not found: {}".format(pk_values), db.name, table_name, pk_values
|
||||
)
|
||||
raise RowNotFound(db.name, table_name, pk_values)
|
||||
return ResolvedRow(db, table_name, sql, params, pks, pk_values, results.first())
|
||||
|
||||
def app(self):
|
||||
|
|
|
|||
|
|
@ -36,8 +36,8 @@ class TableNotFound(NotFound):
|
|||
|
||||
|
||||
class RowNotFound(NotFound):
|
||||
def __init__(self, message, database_name, table, pk_values):
|
||||
super().__init__(message)
|
||||
def __init__(self, database_name, table, pk_values):
|
||||
super().__init__("Row not found")
|
||||
self.database_name = database_name
|
||||
self.table_name = table
|
||||
self.pk_values = pk_values
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue