stages/*: remove path-based import from all stages

This commit is contained in:
Jens Langhammer
2020-07-20 16:23:30 +02:00
parent 6fa825e372
commit a3d92ebc0a
19 changed files with 194 additions and 37 deletions

View File

@ -1,6 +1,10 @@
"""passbook captcha stage"""
from typing import Type
from django.db import models
from django.forms import ModelForm
from django.utils.translation import gettext_lazy as _
from django.views import View
from passbook.flows.models import Stage
@ -19,8 +23,15 @@ class CaptchaStage(Stage):
)
)
type = "passbook.stages.captcha.stage.CaptchaStage"
form = "passbook.stages.captcha.forms.CaptchaStageForm"
def type(self) -> Type[View]:
from passbook.stages.captcha.stage import CaptchaStageView
return CaptchaStageView
def form(self) -> Type[ModelForm]:
from passbook.stages.captcha.forms import CaptchaStageForm
return CaptchaStageForm
def __str__(self):
return f"Captcha Stage {self.name}"

View File

@ -6,7 +6,7 @@ from passbook.flows.stage import StageView
from passbook.stages.captcha.forms import CaptchaForm
class CaptchaStage(FormView, StageView):
class CaptchaStageView(FormView, StageView):
"""Simple captcha checker, logic is handeled in django-captcha module"""
form_class = CaptchaForm