Spaces:
Runtime error
Runtime error
Update app.py
Browse files1098 unmodified lines10991100110111021103110411051106110711081098 unmodified linescursor.execute(query, values)cnx.commit()logging.info(f"Query executed successfully, {cursor.rowcount} row(s) affected")cursor.close()cnx.close()logging.info(f"Data_connectors for {scenario} inserted successfully")return RedirectResponse(url="/prompt_template", status_code=302)except mysql.connector.Error as err:logging.error(f"Database error: {err}")raise HTTPException(status_code=500, detail="Internal Server Error")1098 unmodified lines1099110011011102110311041105110611071108110911101098 unmodified linescursor.execute(query, values)cnx.commit()logging.info(f"Query executed successfully, {cursor.rowcount} row(s) affected")row_id = cursor.lastrowid # Get the last inserted row_idcursor.close()cnx.close()logging.info(f"Data_connectors for {scenario} inserted successfully")return JSONResponse(status_code=200, content={"message": "Data saved successfully", "row_id": row_id})#return RedirectResponse(url="/prompt_template", status_code=302)except mysql.connector.Error as err:logging.error(f"Database error: {err}")raise HTTPException(status_code=500, detail="Internal Server Error")
app.py+3-1