From 489c91560ec8522bff724acc90c2544fa2829a4c Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Tue, 12 Mar 2024 11:46:44 +0100 Subject: [PATCH] add view for delete file_datas register --- idhub/admin/views.py | 13 +++++++++++++ idhub/urls.py | 2 ++ 2 files changed, 15 insertions(+) diff --git a/idhub/admin/views.py b/idhub/admin/views.py index a030f99..aed49ba 100644 --- a/idhub/admin/views.py +++ b/idhub/admin/views.py @@ -1078,3 +1078,16 @@ class ImportAddView(NotifyActivateUserByEmail, ImportExport, FormView): messages.error(self.request, e.message) return super().form_valid(form) + + +class ImportDeleteView(AdminView): + model = PeopleView + + def get(self, request, *args, **kwargs): + self.check_valid_user() + self.pk = kwargs['pk'] + self.object = get_object_or_404(self.model, pk=self.pk) + self.object.delete() + + return redirect('idhub:admin_import') + diff --git a/idhub/urls.py b/idhub/urls.py index d0230c9..cbcadcd 100644 --- a/idhub/urls.py +++ b/idhub/urls.py @@ -176,6 +176,8 @@ urlpatterns = [ name='admin_terms_and_conditions'), path('admin/import/new', views_admin.ImportAddView.as_view(), name='admin_import_add'), + path('admin/import//del', views_admin.ImportDeleteView.as_view(), + name='admin_import_del'), path('admin/enc/', views_admin.EncryptionKeyView.as_view(), name='encryption_key'), path('admin/auth/', views_admin.DobleFactorAuthView.as_view(), name='admin_2fauth'),