kopia lustrzana https://github.com/simonw/datasette
Fix for RowNotFound, refs #2359
rodzic
7316dd4ac6
commit
263788906a
|
@ -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
|
||||
|
|
Ładowanie…
Reference in New Issue