From c4a30c50ac0f01632ded88879d4d9c453dac8c62 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Sat, 17 Oct 2020 17:17:20 +0200 Subject: [PATCH] stages/consent: add fallback template --- e2e/test_provider_proxy.py | 2 -- passbook/stages/consent/stage.py | 3 +-- .../consent/templates/stages/consent/fallback.html | 9 +++++++++ swagger.yaml | 8 ++++---- 4 files changed, 14 insertions(+), 8 deletions(-) create mode 100644 passbook/stages/consent/templates/stages/consent/fallback.html diff --git a/e2e/test_provider_proxy.py b/e2e/test_provider_proxy.py index bc26f8d4f..57be8b831 100644 --- a/e2e/test_provider_proxy.py +++ b/e2e/test_provider_proxy.py @@ -20,9 +20,7 @@ from passbook.outposts.models import ( OutpostConfig, OutpostDeploymentType, OutpostType, - default_outpost_config, ) -from passbook.providers.proxy.controllers.docker import ProxyDockerController from passbook.providers.proxy.models import ProxyProvider diff --git a/passbook/stages/consent/stage.py b/passbook/stages/consent/stage.py index dcb7bce0c..160ab1a84 100644 --- a/passbook/stages/consent/stage.py +++ b/passbook/stages/consent/stage.py @@ -27,11 +27,10 @@ class ConsentStageView(FormView, StageView): def get_template_names(self) -> List[str]: # PLAN_CONTEXT_CONSENT_TEMPLATE has to be set by a template that calls this stage - # TODO: Add a default template in case a user directly implements this stage if PLAN_CONTEXT_CONSENT_TEMPLATE in self.executor.plan.context: template_name = self.executor.plan.context[PLAN_CONTEXT_CONSENT_TEMPLATE] return [template_name] - return super().get_template_names() + return ["stages/consent/fallback.html"] def get(self, request: HttpRequest, *args, **kwargs) -> HttpResponse: current_stage: ConsentStage = self.executor.current_stage diff --git a/passbook/stages/consent/templates/stages/consent/fallback.html b/passbook/stages/consent/templates/stages/consent/fallback.html new file mode 100644 index 000000000..cdb16e689 --- /dev/null +++ b/passbook/stages/consent/templates/stages/consent/fallback.html @@ -0,0 +1,9 @@ +{% extends 'login/form_with_user.html' %} + +{% load i18n %} + +{% block beneath_form %} +
+ {{ hidden_inputs }} +
+{% endblock %} diff --git a/swagger.yaml b/swagger.yaml index 91201caff..413eb5c8a 100755 --- a/swagger.yaml +++ b/swagger.yaml @@ -6087,7 +6087,7 @@ definitions: readOnly: true user: title: User - type: string + type: object action: title: Action type: string @@ -6119,7 +6119,7 @@ definitions: minLength: 1 context: title: Context - type: string + type: object client_ip: title: Client ip type: string @@ -6211,7 +6211,7 @@ definitions: uniqueItems: true attributes: title: Attributes - type: string + type: object Token: required: - identifier @@ -7707,7 +7707,7 @@ definitions: x-nullable: true fixed_data: title: Fixed data - type: string + type: object OTPStaticStage: required: - name