From 22f3ee384daae83c3b72419c4997138b410f6653 Mon Sep 17 00:00:00 2001 From: Patric Stout Date: Sat, 3 Oct 2020 10:40:11 +0200 Subject: [PATCH] Fix: ensure SASTs see only explicit returns happening --- webclient/api.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/webclient/api.py b/webclient/api.py index e93fa85..a62b9b5 100644 --- a/webclient/api.py +++ b/webclient/api.py @@ -92,11 +92,11 @@ def api_call(method, path, params=None, json=None, session=None, return_errors=F # have to the caller pass - if return_errors: - return (None, "API call failed") - else: + if not return_errors: flask.abort(error_response) + return (None, "API call failed") + def api_get(*args, **kwargs): return api_call(requests.get, *args, **kwargs)