bugfix getkintoneformat db
This commit is contained in:
@@ -24,7 +24,7 @@ def getkintoneenv(user = Depends(get_current_user),db = Depends(get_db)):
|
|||||||
return kintoneevn
|
return kintoneevn
|
||||||
|
|
||||||
|
|
||||||
def getkintoneformat(user = Depends(get_current_user),db = Depends(get_db)):
|
def getkintoneformat(db,user = Depends(get_current_user)):
|
||||||
#db = SessionLocal()
|
#db = SessionLocal()
|
||||||
formats = get_kintoneformat(db)
|
formats = get_kintoneformat(db)
|
||||||
#db.close()
|
#db.close()
|
||||||
@@ -627,9 +627,9 @@ async def createapp(request:Request,name:str,env:config.KINTONE_ENV=Depends(getk
|
|||||||
|
|
||||||
|
|
||||||
@r.post("/createappfromexcel",)
|
@r.post("/createappfromexcel",)
|
||||||
async def createappfromexcel(request:Request,files:t.List[UploadFile] = File(...),format:int = 0,env = Depends(getkintoneenv)):
|
async def createappfromexcel(request:Request,files:t.List[UploadFile] = File(...),format:int = 0,env = Depends(getkintoneenv),db = Depends(get_db)):
|
||||||
try:
|
try:
|
||||||
mapping = getkintoneformat()[format]
|
mapping = getkintoneformat(db)[format]
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
raise APIException('kintone:createappfromexcel',request.url._url, f"Error occurred while get kintone format:",e)
|
raise APIException('kintone:createappfromexcel',request.url._url, f"Error occurred while get kintone format:",e)
|
||||||
|
|
||||||
@@ -666,9 +666,9 @@ async def createappfromexcel(request:Request,files:t.List[UploadFile] = File(...
|
|||||||
|
|
||||||
|
|
||||||
@r.post("/updateappfromexcel")
|
@r.post("/updateappfromexcel")
|
||||||
async def updateappfromexcel(request:Request,app:str,files:t.List[UploadFile] = File(...),format:int = 0,env = Depends(getkintoneenv)):
|
async def updateappfromexcel(request:Request,app:str,files:t.List[UploadFile] = File(...),format:int = 0,env = Depends(getkintoneenv),db = Depends(get_db)):
|
||||||
try:
|
try:
|
||||||
mapping = getkintoneformat()[format]
|
mapping = getkintoneformat(db)[format]
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
raise APIException('kintone:updateappfromexcel',request.url._url, f"Error occurred while get kintone format:",e)
|
raise APIException('kintone:updateappfromexcel',request.url._url, f"Error occurred while get kintone format:",e)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user