From c35dc21793995c3a0ed8d147a32d39786a5b0429 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agn=C3=A8s=20Haasser?= Date: Tue, 12 Apr 2022 11:21:01 +0200 Subject: [PATCH 1/2] Fix inheritance issues --- aidants_connect_habilitation/views.py | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/aidants_connect_habilitation/views.py b/aidants_connect_habilitation/views.py index 9424ea7ca..f16ddb869 100644 --- a/aidants_connect_habilitation/views.py +++ b/aidants_connect_habilitation/views.py @@ -79,10 +79,6 @@ def dispatch(self, request, *args, **kwargs): class LateStageRequestView(VerifiedEmailIssuerView, View): - @property - def step(self) -> HabilitationFormStep: - raise NotImplementedError() - def setup(self, request, *args, **kwargs): super().setup(request, *args, **kwargs) self.organisation = get_object_or_404( @@ -90,11 +86,7 @@ def setup(self, request, *args, **kwargs): ) -class OnlyNewRequestsView(LateStageRequestView): - @property - def step(self) -> HabilitationFormStep: - raise NotImplementedError() - +class OnlyNewRequestsView(HabilitationStepMixin, LateStageRequestView): def dispatch(self, request, *args, **kwargs): if not self.issuer.email_verified: # Duplicate logic of VerifiedEmailIssuerView @@ -287,7 +279,7 @@ def get_form_kwargs(self): return {**super().get_form_kwargs(), "instance": self.organisation} -class PersonnelRequestFormView(OnlyNewRequestsView, HabilitationStepMixin, FormView): +class PersonnelRequestFormView(OnlyNewRequestsView, FormView): template_name = "personnel_form.html" form_class = PersonnelForm @@ -338,7 +330,7 @@ def get_success_url(self): ) -class ValidationRequestFormView(OnlyNewRequestsView, HabilitationStepMixin, FormView): +class ValidationRequestFormView(OnlyNewRequestsView, FormView): template_name = "validation_form.html" form_class = ValidationForm From 11df410f5f784da41b97aa1c96a7504d9bee5ce0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agn=C3=A8s=20Haasser?= Date: Tue, 12 Apr 2022 11:28:52 +0200 Subject: [PATCH 2/2] Declare abstract method in abstract class --- aidants_connect_habilitation/views.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aidants_connect_habilitation/views.py b/aidants_connect_habilitation/views.py index f16ddb869..4bc7737ea 100644 --- a/aidants_connect_habilitation/views.py +++ b/aidants_connect_habilitation/views.py @@ -87,6 +87,10 @@ def setup(self, request, *args, **kwargs): class OnlyNewRequestsView(HabilitationStepMixin, LateStageRequestView): + @property + def step(self) -> HabilitationFormStep: + raise NotImplementedError() + def dispatch(self, request, *args, **kwargs): if not self.issuer.email_verified: # Duplicate logic of VerifiedEmailIssuerView