updated backend author service, to handle the fact that SQLAlchemy rows arent tuples
This commit is contained in:
@@ -62,10 +62,7 @@ async def list_authors(
|
||||
result = await db.execute(base)
|
||||
authors = []
|
||||
for row in result.all():
|
||||
if isinstance(row, tuple):
|
||||
author = row[0]
|
||||
else:
|
||||
author = row
|
||||
data = {c.name: getattr(author, c.name) for c in author.__table__.columns}
|
||||
authors.append(data)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user