Parcourir la source

fix key error

ming il y a 3 ans
Parent
commit
9fd5bd914a
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  1. 1 1
      api/main.py

+ 1 - 1
api/main.py

@@ -109,7 +109,7 @@ async def get_courses(cids:List[int]):
     statement = 'SELECT * FROM course WHERE id IN'+cid_str
 
     for row in db.query(statement):
-        courses.append({'id':row['course_id'],'title':row['title'],'url':row['url']
+        courses.append({'id':row['id'],'title':row['title'],'url':row['url']
         ,'teacher_name':['teacher_name'],'price':row['price'],'price_discount':row['price_discount'],'profile':row['profile']
         ,'cover_img':'https://'+serverADDR + row['cover_img'],'hours':row['hours'],'units':row['units']})
     return courses