stages/consent: add fallback template

This commit is contained in:
Jens Langhammer 2020-10-17 17:17:20 +02:00
parent 2831df45a0
commit c4a30c50ac
4 changed files with 14 additions and 8 deletions

View file

@ -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

View file

@ -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

View file

@ -0,0 +1,9 @@
{% extends 'login/form_with_user.html' %}
{% load i18n %}
{% block beneath_form %}
<div class="pf-c-form__group">
{{ hidden_inputs }}
</div>
{% endblock %}

View file

@ -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