From 708c2cbdfa8179d0f6ab87c896c5924e273c6733 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Wed, 14 Sep 2022 14:58:54 +0200 Subject: [PATCH] forze Phid to be string --- ereuse_devicehub/inventory/forms.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ereuse_devicehub/inventory/forms.py b/ereuse_devicehub/inventory/forms.py index 2627118c..e367dddf 100644 --- a/ereuse_devicehub/inventory/forms.py +++ b/ereuse_devicehub/inventory/forms.py @@ -1520,7 +1520,9 @@ class UploadPlaceholderForm(FlaskForm): else: self.source = "Excel File: {}".format(_file.filename) try: - data = pd.read_excel(_file).fillna('').to_dict() + data = ( + pd.read_excel(_file, converters={'Phid': str}).fillna('').to_dict() + ) except ValueError: txt = ["File don't have a correct format"] self.placeholder_file.errors = txt