stages/*: remove path-based import from all stages
This commit is contained in:
@ -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}"
|
||||
|
||||
@ -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
|
||||
|
||||
Reference in New Issue
Block a user