stages/consent: add fallback template
This commit is contained in:
		| @ -20,9 +20,7 @@ from passbook.outposts.models import ( | |||||||
|     OutpostConfig, |     OutpostConfig, | ||||||
|     OutpostDeploymentType, |     OutpostDeploymentType, | ||||||
|     OutpostType, |     OutpostType, | ||||||
|     default_outpost_config, |  | ||||||
| ) | ) | ||||||
| from passbook.providers.proxy.controllers.docker import ProxyDockerController |  | ||||||
| from passbook.providers.proxy.models import ProxyProvider | from passbook.providers.proxy.models import ProxyProvider | ||||||
|  |  | ||||||
|  |  | ||||||
|  | |||||||
| @ -27,11 +27,10 @@ class ConsentStageView(FormView, StageView): | |||||||
|  |  | ||||||
|     def get_template_names(self) -> List[str]: |     def get_template_names(self) -> List[str]: | ||||||
|         # PLAN_CONTEXT_CONSENT_TEMPLATE has to be set by a template that calls this stage |         # 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: |         if PLAN_CONTEXT_CONSENT_TEMPLATE in self.executor.plan.context: | ||||||
|             template_name = self.executor.plan.context[PLAN_CONTEXT_CONSENT_TEMPLATE] |             template_name = self.executor.plan.context[PLAN_CONTEXT_CONSENT_TEMPLATE] | ||||||
|             return [template_name] |             return [template_name] | ||||||
|         return super().get_template_names() |         return ["stages/consent/fallback.html"] | ||||||
|  |  | ||||||
|     def get(self, request: HttpRequest, *args, **kwargs) -> HttpResponse: |     def get(self, request: HttpRequest, *args, **kwargs) -> HttpResponse: | ||||||
|         current_stage: ConsentStage = self.executor.current_stage |         current_stage: ConsentStage = self.executor.current_stage | ||||||
|  | |||||||
| @ -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 %} | ||||||
| @ -6087,7 +6087,7 @@ definitions: | |||||||
|         readOnly: true |         readOnly: true | ||||||
|       user: |       user: | ||||||
|         title: User |         title: User | ||||||
|         type: string |         type: object | ||||||
|       action: |       action: | ||||||
|         title: Action |         title: Action | ||||||
|         type: string |         type: string | ||||||
| @ -6119,7 +6119,7 @@ definitions: | |||||||
|         minLength: 1 |         minLength: 1 | ||||||
|       context: |       context: | ||||||
|         title: Context |         title: Context | ||||||
|         type: string |         type: object | ||||||
|       client_ip: |       client_ip: | ||||||
|         title: Client ip |         title: Client ip | ||||||
|         type: string |         type: string | ||||||
| @ -6211,7 +6211,7 @@ definitions: | |||||||
|         uniqueItems: true |         uniqueItems: true | ||||||
|       attributes: |       attributes: | ||||||
|         title: Attributes |         title: Attributes | ||||||
|         type: string |         type: object | ||||||
|   Token: |   Token: | ||||||
|     required: |     required: | ||||||
|       - identifier |       - identifier | ||||||
| @ -7707,7 +7707,7 @@ definitions: | |||||||
|         x-nullable: true |         x-nullable: true | ||||||
|       fixed_data: |       fixed_data: | ||||||
|         title: Fixed data |         title: Fixed data | ||||||
|         type: string |         type: object | ||||||
|   OTPStaticStage: |   OTPStaticStage: | ||||||
|     required: |     required: | ||||||
|       - name |       - name | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user
	 Jens Langhammer
					Jens Langhammer