From da6ae895a373ca91bd3ccd3d40d4d9d5320d1b78 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Thu, 29 Feb 2024 11:47:05 +0100 Subject: [PATCH] fix phoneNumber as string --- idhub/admin/forms.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/idhub/admin/forms.py b/idhub/admin/forms.py index e63a4b3..3796969 100644 --- a/idhub/admin/forms.py +++ b/idhub/admin/forms.py @@ -224,7 +224,9 @@ class ImportForm(forms.Form): if not self._schema: return data - df = pd.read_excel(data) + # Forze than pandas read one column as string + dtype_dict = {"phoneNumber": str} + df = pd.read_excel(data, dtype=dtype_dict) df.fillna('', inplace=True) try: