stages/otp_time: fix linting
This commit is contained in:
parent
a76eb4d30f
commit
3716bda76e
|
@ -1,11 +1,11 @@
|
||||||
"""TOTP Setup stage"""
|
"""TOTP Setup stage"""
|
||||||
from typing import Any, Dict
|
from typing import Any, Dict
|
||||||
|
|
||||||
import lxml.etree as ET # nosec
|
|
||||||
from django.http import HttpRequest, HttpResponse
|
from django.http import HttpRequest, HttpResponse
|
||||||
from django.utils.encoding import force_text
|
from django.utils.encoding import force_text
|
||||||
from django.views.generic import FormView
|
from django.views.generic import FormView
|
||||||
from django_otp.plugins.otp_totp.models import TOTPDevice
|
from django_otp.plugins.otp_totp.models import TOTPDevice
|
||||||
|
from lxml.etree import tostring # nosec
|
||||||
from qrcode import QRCode
|
from qrcode import QRCode
|
||||||
from qrcode.image.svg import SvgFillImage
|
from qrcode.image.svg import SvgFillImage
|
||||||
from structlog import get_logger
|
from structlog import get_logger
|
||||||
|
@ -35,7 +35,7 @@ class OTPTimeStageView(FormView, StageView):
|
||||||
"""Get QR Code SVG as string based on `device`"""
|
"""Get QR Code SVG as string based on `device`"""
|
||||||
qr_code = QRCode(image_factory=SvgFillImage)
|
qr_code = QRCode(image_factory=SvgFillImage)
|
||||||
qr_code.add_data(device.config_url)
|
qr_code.add_data(device.config_url)
|
||||||
return force_text(ET.tostring(qr_code.make_image().get_image()))
|
return force_text(tostring(qr_code.make_image().get_image()))
|
||||||
|
|
||||||
def get(self, request: HttpRequest, *args, **kwargs) -> HttpResponse:
|
def get(self, request: HttpRequest, *args, **kwargs) -> HttpResponse:
|
||||||
user = self.executor.plan.context.get(PLAN_CONTEXT_PENDING_USER)
|
user = self.executor.plan.context.get(PLAN_CONTEXT_PENDING_USER)
|
||||||
|
|
Reference in New Issue