diff --git a/app/admin/router.py b/app/admin/router.py index 93ef3c3..36b2d2f 100644 --- a/app/admin/router.py +++ b/app/admin/router.py @@ -53,7 +53,7 @@ async def dashboard(request: Request): ) total_revenue = float((await session.execute(rev_stmt)).scalar_one()) - logger.debug( + logger.info( "Dashboard data: users={}/{} tariffs={} servers={}/{} payments={}/{} revenue={}", active_users, total_users, total_tariffs, active_servers, total_servers, diff --git a/app/main.py b/app/main.py index a82717b..3db8f4f 100644 --- a/app/main.py +++ b/app/main.py @@ -62,11 +62,14 @@ async def validation_exception_handler( request: Request, exc: RequestValidationError ): logger.warning("Validation error: {}", exc.errors()) + body = exc.body + if body is not None and not isinstance(body, (dict, list, str, int, float, bool, type(None))): + body = str(body) return JSONResponse( status_code=422, content={ "detail": exc.errors(), - "body": exc.body, + "body": body, }, )