From b6711cbe2b1c7afcf7cd88730ed3112e733a4258 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Mon, 26 Feb 2024 17:31:21 +0100 Subject: [PATCH 1/3] excel with only 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 06d09e8..06ff222 100644 --- a/idhub/admin/forms.py +++ b/idhub/admin/forms.py @@ -225,7 +225,7 @@ class ImportForm(forms.Form): data_pd = df.fillna('').to_dict() - if not data_pd or not df.last_valid_index(): + if not data_pd or df.last_valid_index() is None: self.exception("The file you try to import is empty!") if not self._schema: From 08af99370f27d235006bb317ec3b9df5e5699b78 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Mon, 26 Feb 2024 17:50:22 +0100 Subject: [PATCH 2/3] remove columns empty --- idhub/admin/forms.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/idhub/admin/forms.py b/idhub/admin/forms.py index 06ff222..d3af58d 100644 --- a/idhub/admin/forms.py +++ b/idhub/admin/forms.py @@ -234,7 +234,8 @@ class ImportForm(forms.Form): for n in range(df.last_valid_index()+1): row = {} for k in data_pd.keys(): - row[k] = data_pd[k][n] or '' + if data_pd[k][n]: + row[k] = data_pd[k][n] user = self.validate_jsonld(n, row) self.rows[user] = row From 120b1e0c6976f7f4e9ba59a4e76ac0232528eeed Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Mon, 26 Feb 2024 18:05:19 +0100 Subject: [PATCH 3/3] fix dids of eidas1 link to organization --- idhub/admin/forms.py | 2 -- idhub/admin/views.py | 5 ----- 2 files changed, 7 deletions(-) diff --git a/idhub/admin/forms.py b/idhub/admin/forms.py index d3af58d..dc6a1da 100644 --- a/idhub/admin/forms.py +++ b/idhub/admin/forms.py @@ -401,7 +401,6 @@ class ImportCertificateForm(forms.Form): self._did = None self._s = None self._label = None - self.user = kwargs.pop('user', None) super().__init__(*args, **kwargs) def clean(self): @@ -434,7 +433,6 @@ class ImportCertificateForm(forms.Form): did=self.file_name, label=self._label, eidas1=True, - user=self.user, type=DID.Types.KEY ) diff --git a/idhub/admin/views.py b/idhub/admin/views.py index 1c5aaa4..5ead31a 100644 --- a/idhub/admin/views.py +++ b/idhub/admin/views.py @@ -840,11 +840,6 @@ class WalletConfigIssuesView(Credentials, FormView): form_class = ImportCertificateForm success_url = reverse_lazy('idhub:admin_dids') - def get_form_kwargs(self): - kwargs = super().get_form_kwargs() - kwargs['user'] = self.request.user - return kwargs - def form_valid(self, form): cred = form.save() if cred: