From 8c2ba3403de69553d48800e1b791ba27867e97ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adolfo=20G=C3=B3mez=20Garc=C3=ADa?= Date: Mon, 21 Oct 2024 16:33:20 +0200 Subject: [PATCH] Simple reformating --- server/src/uds/web/views/errors.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/server/src/uds/web/views/errors.py b/server/src/uds/web/views/errors.py index 90d8e9dde..a0cb7300a 100644 --- a/server/src/uds/web/views/errors.py +++ b/server/src/uds/web/views/errors.py @@ -48,6 +48,7 @@ if typing.TYPE_CHECKING: logger = logging.getLogger(__name__) + def error(request: 'HttpRequest', err: str) -> 'HttpResponse': """ Error view, responsible of error display @@ -55,19 +56,17 @@ def error(request: 'HttpRequest', err: str) -> 'HttpResponse': return render(request, 'uds/modern/index.html', {}) - - def error_message(request: 'HttpRequest', err: str) -> 'HttpResponse': """ Error view, responsible of error display """ # get error as integer or replace it by 0 - + try: err_int = int(err) except Exception: err_int = 0 - + return HttpResponse( json.dumps({'error': types.errors.Error.from_int(err_int).message, 'code': str(err)}), content_type='application/json',