Skip to content

Commit

Permalink
Fix for RowNotFound, refs #2359
Browse files Browse the repository at this point in the history
  • Loading branch information
simonw committed Jun 21, 2024
1 parent 7316dd4 commit 2637889
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 1 addition & 3 deletions datasette/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -1638,9 +1638,7 @@ async def resolve_row(self, request):
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):
Expand Down
4 changes: 2 additions & 2 deletions datasette/utils/asgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ def __init__(self, database_name, table):


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
Expand Down

0 comments on commit 2637889

Please sign in to comment.