File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -186,8 +186,9 @@ def enabled_handler(enabled: bool, request: Request):
186186 raise HTTPException (status_code = status .HTTP_401_UNAUTHORIZED )
187187 print (f"enabled={ enabled } " )
188188 try :
189+ r = ""
189190 if enabled :
190- ocs_call (
191+ result = ocs_call (
191192 "POST" ,
192193 "/ocs/v1.php/apps/app_api/api/v1/files/actions/menu" ,
193194 json_data = {
@@ -200,15 +201,19 @@ def enabled_handler(enabled: bool, request: Request):
200201 }
201202 },
202203 )
204+ response_data = json .loads (result .text )
205+ ocs_meta = response_data ["ocs" ]["meta" ]
206+ if ocs_meta ["status" ] != "ok" :
207+ r = f"error: { ocs_meta ['message' ]} "
203208 else :
204209 ocs_call (
205210 "DELETE" ,
206211 "/ocs/v1.php/apps/app_api/api/v1/files/actions/menu" ,
207212 json_data = {"fileActionMenuName" : "upscale" },
208213 )
209- r = ""
210214 except Exception as e :
211215 r = str (e )
216+ print (f"enabled={ enabled } -> { r } " )
212217 return responses .JSONResponse (content = {"error" : r }, status_code = 200 )
213218
214219
You can’t perform that action at this time.
0 commit comments