From 6df36f97e825b9590523f3d535376cc9321789cb Mon Sep 17 00:00:00 2001 From: Maciej Pienczyn Date: Wed, 18 Feb 2026 12:41:54 +0100 Subject: [PATCH] fix: Map portal role codes to Polish labels in chatbot context MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit MANAGER/EMPLOYEE/VIEWER are portal permission levels, not job titles. Rename field to portal_role with labels: administrator profilu, pracownik, obserwator — so chatbot doesn't misinterpret them as company positions. Co-Authored-By: Claude Opus 4.6 --- nordabiz_chat.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nordabiz_chat.py b/nordabiz_chat.py index 335ee0d..77f179b 100644 --- a/nordabiz_chat.py +++ b/nordabiz_chat.py @@ -578,10 +578,12 @@ class NordaBizChatEngine: company_profile = f"https://nordabiznes.pl/company/{u.company.slug}" if u.company and u.company.slug else None if company_name not in users_by_company: users_by_company[company_name] = {'profile': company_profile, 'users': []} + # Map portal role codes to human-readable Polish labels + role_labels = {'MANAGER': 'administrator profilu', 'EMPLOYEE': 'pracownik', 'VIEWER': 'obserwator'} users_by_company[company_name]['users'].append({ 'name': u.name, 'email': u.email, - 'role': u.company_role if u.company_role != 'NONE' else '', + 'portal_role': role_labels.get(u.company_role, ''), 'member': u.is_norda_member, 'verified': u.is_verified })