domain切替バグ修正

This commit is contained in:
2023-11-20 01:50:02 +09:00
parent f83dd693d5
commit e20625abdb
7 changed files with 18 additions and 12 deletions

View File

@@ -260,9 +260,9 @@ def updateappjscss(app,uploads,c:config.KINTONE_ENV):
r = httpx.put(url,headers=headers,data=json.dumps(data))
return r.json()
def createappjs(app):
def createappjs(domainid,app):
db = SessionLocal()
flows = get_flows_by_app(db,app)
flows = get_flows_by_app(db,domainid,app)
db.close()
content={}
for flow in flows:
@@ -516,12 +516,12 @@ async def updateprocessfromexcel(app:str,env = Depends(getkintoneenv)):
@r.post("/createjstokintone",)
async def createjstokintone(app:str,env = Depends(getkintoneenv)):
async def createjstokintone(app:str,env:config.KINTONE_ENV = Depends(getkintoneenv)):
try:
jscs=[]
files=[]
files.append(createappjs(app))
files.append(createappjs(env.DOMAIN_ID, app))
files.append('Temp\\alc_runtime.js')
for file in files:
upload = uploadkintonefiles(file,env)

View File

@@ -107,6 +107,7 @@ async def flow_list(
db=Depends(get_db),
):
domain = get_activedomain(db, user.id)
print("domain=>",domain)
flows = get_flows_by_app(db, domain.id, appid)
return flows

View File

@@ -23,8 +23,11 @@ class KINTONE_ENV:
API_V1_AUTH_VALUE = ""
KINTONE_USER = ""
DOMAIN_ID = ""
def __init__(self,domain) -> None:
self.DOMAIN_ID=domain.id
self.BASE_URL = domain.url
self.KINTONE_USER = domain.kintoneuser
self.API_V1_AUTH_VALUE = base64.b64encode(bytes(f"{domain.kintoneuser}:{domain.kintonepwd}","utf-8"))