Spaces:
Runtime error
Runtime error
Update app.py
Browse files440 unmodified lines441442443444445446447448449450451440 unmodified linesvalues = (company_id,file_path, documentName, documentDescription, department, version,vectorDBflag, lastUpdated)cursor.execute(query, values)cnx.commit()cursor.close()cnx.close()logging.info(f"Document {documentName} uploaded successfully")return RedirectResponse(url="/knowledgebase", status_code=302)except mysql.connector.Error as err:logging.error(f"Database error: {err}")raise HTTPException(status_code=500, detail="Internal Server Error")440 unmodified lines441442443444445446447448449450451452453440 unmodified linesvalues = (company_id,file_path, documentName, documentDescription, department, version,vectorDBflag, lastUpdated)cursor.execute(query, values)cnx.commit()row_id=cursor.lastrowidcursor.close()cnx.close()logging.info(f"Document {documentName} uploaded successfully")return JSONResponse(status_code=200, content={"message": "Data saved successfully", "row_id": row_id})#return RedirectResponse(url="/knowledgebase", 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