From 440dc217d8fc751e739f27a5e6882e628f6f6f1c Mon Sep 17 00:00:00 2001 From: pranav-afk Date: Mon, 13 Jul 2026 17:36:48 +0530 Subject: [PATCH] fix: coerce is_telemetry_enabled form values on instance admin signup Form-encoded signup can post is_telemetry_enabled as the string false or true. Assigning that string to a BooleanField caused save() to 500 after creating the admin user, leaving the instance half-configured. Coerce the value to a real bool before writing. Writes already run in transaction.atomic. Fixes #9370 --- apps/api/plane/license/api/views/admin.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/apps/api/plane/license/api/views/admin.py b/apps/api/plane/license/api/views/admin.py index aa5ed368032..9246c508bca 100644 --- a/apps/api/plane/license/api/views/admin.py +++ b/apps/api/plane/license/api/views/admin.py @@ -126,7 +126,18 @@ def post(self, request): first_name = request.POST.get("first_name", False) last_name = request.POST.get("last_name", "") company_name = request.POST.get("company_name", "") - is_telemetry_enabled = request.POST.get("is_telemetry_enabled", True) + # Form posts may send "true"/"false" strings; coerce to a real bool so + # assignment to Instance.is_telemetry_enabled does not 500 on save. + is_telemetry_enabled_raw = request.POST.get("is_telemetry_enabled", True) + if isinstance(is_telemetry_enabled_raw, bool): + is_telemetry_enabled = is_telemetry_enabled_raw + else: + is_telemetry_enabled = str(is_telemetry_enabled_raw).strip().lower() in { + "1", + "true", + "yes", + "on", + } # return error if the email and password is not present if not email or not password or not first_name: