use deco to avoid current_user (#26077)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This commit is contained in:
@@ -22,7 +22,7 @@ def register_external_error_handlers(api: Api):
|
||||
got_request_exception.send(current_app, exception=e)
|
||||
|
||||
# If Werkzeug already prepared a Response, just use it.
|
||||
if getattr(e, "response", None) is not None:
|
||||
if e.response is not None:
|
||||
return e.response
|
||||
|
||||
status_code = getattr(e, "code", 500) or 500
|
||||
@@ -106,7 +106,7 @@ def register_external_error_handlers(api: Api):
|
||||
# Log stack
|
||||
exc_info: Any = sys.exc_info()
|
||||
if exc_info[1] is None:
|
||||
exc_info = None
|
||||
exc_info = (None, None, None)
|
||||
current_app.log_exception(exc_info)
|
||||
|
||||
return data, status_code
|
||||
|
||||
Reference in New Issue
Block a user