docs: add docs for flows, start docs for stages

This commit is contained in:
Jens Langhammer
2020-05-30 22:36:01 +02:00
parent 8b4558fcd0
commit 08302a04bf
13 changed files with 81 additions and 32 deletions

View File

@ -34,6 +34,7 @@ class EmailStageForm(forms.ModelForm):
widgets = {
"name": forms.TextInput(),
"host": forms.TextInput(),
"subject": forms.TextInput(),
"username": forms.TextInput(),
"password": forms.TextInput(),
}

View File

@ -46,6 +46,9 @@ class EmailStageView(FormView, StageView):
return super().get(request, *args, **kwargs)
def form_invalid(self, form: EmailStageSendForm) -> HttpResponse:
if PLAN_CONTEXT_PENDING_USER not in self.executor.plan.context:
messages.error(self.request, _("No pending user."))
return super().form_invalid(form)
pending_user = self.executor.plan.context[PLAN_CONTEXT_PENDING_USER]
valid_delta = timedelta(
minutes=self.executor.current_stage.token_expiry + 1