From 4e8807ba3596282faaca5e0aa40337d89bf455dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=98=D0=B3=D0=BE=D1=80=D1=8C=20=D0=9D=D0=B0=D0=B4=D0=B5?= =?UTF-8?q?=D0=B8=D0=BD?= Date: Fri, 21 Nov 2025 13:39:06 +0300 Subject: [PATCH] Fix ApiResponse.content error and add API base URL logging - Changed resp.content to resp.text in register_view (ApiResponse has no content attribute) - Added logging for API base URL to debug 404 errors - This should help identify why API returns 404 for registration endpoint --- backend/employees/views_auth.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/employees/views_auth.py b/backend/employees/views_auth.py index 987b06c7..9e530d10 100644 --- a/backend/employees/views_auth.py +++ b/backend/employees/views_auth.py @@ -89,10 +89,11 @@ def register_view(request): logger.warning(f"[REGISTER_VIEW] API payload keys: {list(payload.keys())}") payload_debug = {k: v for k, v in payload.items() if k != 'avatar'} logger.warning(f"[REGISTER_VIEW] API payload (без avatar): {payload_debug}") + logger.warning(f"[REGISTER_VIEW] API base URL: {api.cfg.base_url}") resp = api.post("v1/auth/register/", json=payload) logger.warning(f"[REGISTER_VIEW] API response status: {resp.status}") - resp_data = resp.json if resp.json else resp.content + resp_data = resp.json if resp.json else resp.text logger.warning(f"[REGISTER_VIEW] API response: {resp_data}") if resp.status == 201: