From 1e53adbd04c87557daa408231e05ac3c8122a12c Mon Sep 17 00:00:00 2001 From: Patryk Dabrowski Date: Mon, 9 Sep 2024 12:15:31 +0200 Subject: [PATCH] remove invalid redirect --- .../apps/registration_data/admin.py | 21 +------------------ 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/backend/hct_mis_api/apps/registration_data/admin.py b/backend/hct_mis_api/apps/registration_data/admin.py index b8843fe9f4..e65f602dfb 100644 --- a/backend/hct_mis_api/apps/registration_data/admin.py +++ b/backend/hct_mis_api/apps/registration_data/admin.py @@ -13,7 +13,7 @@ from django.utils.safestring import mark_safe from admin_extra_buttons.api import confirm_action -from admin_extra_buttons.decorators import button, link +from admin_extra_buttons.decorators import button from adminfilters.autocomplete import AutoCompleteFilter from adminfilters.filters import ChoicesFieldComboFilter, ValueFilter from adminfilters.mixin import AdminAutoCompleteSearchMixin @@ -65,19 +65,6 @@ class RegistrationDataImportAdmin(AdminAutoCompleteSearchMixin, HOPEModelAdminBa def get_queryset(self, request: HttpRequest) -> QuerySet: return super().get_queryset(request).select_related("business_area") - @link( - label="HUB RDI", - # permission=lambda r, o: r.user.is_superuser, - # visible=lambda btn: btn.original.status == RegistrationDataImport.IMPORT_ERROR, - ) - def hub(self, button: button) -> Optional[str]: - obj = button.context.get("original") - if obj: - return reverse("admin:registration_data_registrationdataimportdatahub_change", args=[obj.datahub_id]) - - button.visible = False - return None - @button( label="Re-run RDI", permission=lambda r, o, handler: r.user.is_superuser, @@ -269,12 +256,6 @@ def households(self, request: HttpRequest, pk: UUID) -> HttpResponseRedirect: url = reverse("admin:household_household_changelist") return HttpResponseRedirect(f"{url}?&qs=registration_data_import__exact={obj.id}") - @button() - def hub_rdi(self, request: HttpRequest, pk: UUID) -> HttpResponseRedirect: - obj = self.get_object(request, str(pk)) - url = reverse("admin:registration_datahub_registrationdataimportdatahub_change", args=[obj.datahub_id]) - return HttpResponseRedirect(url) - @button(permission="program.enroll_beneficiaries") def enroll_to_program(self, request: HttpRequest, pk: UUID) -> Optional[HttpResponse]: url = reverse("admin:registration_data_registrationdataimport_change", args=[pk])