updated backend author service, to handle the fact that SQLAlchemy rows arent tuples

This commit is contained in:
2026-03-10 19:31:43 -05:00
parent 5bd9a1649c
commit e6de767ddb

View File

@@ -62,10 +62,7 @@ async def list_authors(
result = await db.execute(base) result = await db.execute(base)
authors = [] authors = []
for row in result.all(): for row in result.all():
if isinstance(row, tuple):
author = row[0] author = row[0]
else:
author = row
data = {c.name: getattr(author, c.name) for c in author.__table__.columns} data = {c.name: getattr(author, c.name) for c in author.__table__.columns}
authors.append(data) authors.append(data)