From c3358e73b7017129cdeb171e1c6c95c0dea027a9 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Thu, 29 Feb 2024 13:04:54 +0100 Subject: [PATCH 1/3] fix excel with one line --- idhub/admin/forms.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/idhub/admin/forms.py b/idhub/admin/forms.py index 360b596..22922f6 100644 --- a/idhub/admin/forms.py +++ b/idhub/admin/forms.py @@ -197,7 +197,7 @@ class ImportForm(forms.Form): if not data_pd: self.exception(_("This file is empty!")) - if not df.last_valid_index(): + if df.last_valid_index() is None: self.exception(_("This file is badly formatted!")) for n in range(df.last_valid_index()+1): From 9d23d59b93a2687ce3755b4bb74d500a6645b1f1 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Thu, 29 Feb 2024 18:19:34 +0100 Subject: [PATCH 2/3] create test users for all instances --- idhub/management/commands/initial_datas.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/idhub/management/commands/initial_datas.py b/idhub/management/commands/initial_datas.py index e8abf19..692564e 100644 --- a/idhub/management/commands/initial_datas.py +++ b/idhub/management/commands/initial_datas.py @@ -25,10 +25,10 @@ class Command(BaseCommand): ADMIN_PASSWORD = config('ADMIN_PASSWORD', '1234') self.create_admin_users(ADMIN_EMAIL, ADMIN_PASSWORD) - if settings.CREATE_TEST_USERS: - for u in range(1, 6): - user = 'user{}@example.org'.format(u) - self.create_users(user, '1234') + # if settings.CREATE_TEST_USERS: + for u in range(1, 6): + user = 'user{}@example.org'.format(u) + self.create_users(user, '1234') BASE_DIR = Path(__file__).resolve().parent.parent.parent.parent ORGANIZATION = os.path.join(BASE_DIR, settings.ORG_FILE) From c20f75dce923124833402fefc9c8380cdcc2194a Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Thu, 29 Feb 2024 18:25:59 +0100 Subject: [PATCH 3/3] revert commit --- idhub/management/commands/initial_datas.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/idhub/management/commands/initial_datas.py b/idhub/management/commands/initial_datas.py index 692564e..e8abf19 100644 --- a/idhub/management/commands/initial_datas.py +++ b/idhub/management/commands/initial_datas.py @@ -25,10 +25,10 @@ class Command(BaseCommand): ADMIN_PASSWORD = config('ADMIN_PASSWORD', '1234') self.create_admin_users(ADMIN_EMAIL, ADMIN_PASSWORD) - # if settings.CREATE_TEST_USERS: - for u in range(1, 6): - user = 'user{}@example.org'.format(u) - self.create_users(user, '1234') + if settings.CREATE_TEST_USERS: + for u in range(1, 6): + user = 'user{}@example.org'.format(u) + self.create_users(user, '1234') BASE_DIR = Path(__file__).resolve().parent.parent.parent.parent ORGANIZATION = os.path.join(BASE_DIR, settings.ORG_FILE)