From 184ab557d2c5f39eb48a9d0fd6728e1d98f37a1c Mon Sep 17 00:00:00 2001 From: Irwan Fathurrahman Date: Tue, 30 Apr 2024 06:59:50 +0700 Subject: [PATCH] [Version 1.40.8] Fix bug importer trailing space column name --- django_project/geosight/importer/admin.py | 2 +- django_project/geosight/importer/importers/excel/_base.py | 4 ++-- django_project/version/version.txt | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/django_project/geosight/importer/admin.py b/django_project/geosight/importer/admin.py index 6d9fb7f7d..d1088e13e 100644 --- a/django_project/geosight/importer/admin.py +++ b/django_project/geosight/importer/admin.py @@ -26,7 +26,7 @@ def import_data(modeladmin, request, queryset): """Run importers.""" for importer in queryset: - run_importer.delay(importer.id) + run_importer(importer.id) import_data.short_description = 'Run import data' diff --git a/django_project/geosight/importer/importers/excel/_base.py b/django_project/geosight/importer/importers/excel/_base.py index ddda250f0..106afa16d 100644 --- a/django_project/geosight/importer/importers/excel/_base.py +++ b/django_project/geosight/importer/importers/excel/_base.py @@ -104,12 +104,12 @@ def get_records(self) -> List: row = {} for idx, header in enumerate(headers): try: - row[header] = clean_value(record[idx]) + row[header.strip()] = clean_value(record[idx]) except (ValueError, IndexError): pass for key, value in self.mapping.items(): try: - row[value] = clean_value(row[key]) + row[value] = clean_value(row[key.strip()]) except KeyError: pass data.append(row) diff --git a/django_project/version/version.txt b/django_project/version/version.txt index 5679b37ea..8e243e11d 100644 --- a/django_project/version/version.txt +++ b/django_project/version/version.txt @@ -1 +1 @@ -1.40.7 \ No newline at end of file +1.40.8 \ No newline at end of file