Merge pull request 'update(checkin tool web): update status when status from server and tool are wrong' (#160) from zelda.refactor-tracking-tool-web into master
Reviewed-on: #160
This commit is contained in:
commit
9d536955e4
|
|
@ -341,7 +341,7 @@ async def checkin(background_tasks: BackgroundTasks, file: UploadFile = File(...
|
|||
).fetchone()
|
||||
status = "check out" if last_log and last_log.status == "check in" else "check in"
|
||||
|
||||
db.execute(
|
||||
insert_result = db.execute(
|
||||
text("""
|
||||
INSERT INTO checkin_logs (student_id, time, camera_id, status)
|
||||
VALUES (:student_id, :time, :camera_id, :status)
|
||||
|
|
@ -353,8 +353,8 @@ async def checkin(background_tasks: BackgroundTasks, file: UploadFile = File(...
|
|||
"status": status
|
||||
}
|
||||
)
|
||||
log_id = insert_result.lastrowid
|
||||
db.commit()
|
||||
log_id = db.execute(text("SELECT LAST_INSERT_ID()")).scalar()
|
||||
|
||||
def _sync_to_ms(name: str, time_string: str, img_data: bytes, local_status: str, checkin_log_id: int):
|
||||
try:
|
||||
|
|
|
|||
Loading…
Reference in New Issue