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)
|
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)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user