stages/otp_time: fix linting

This commit is contained in:
Jens Langhammer 2020-06-30 13:44:09 +02:00
parent a76eb4d30f
commit 3716bda76e

View file

@ -1,11 +1,11 @@
"""TOTP Setup stage"""
from typing import Any, Dict
import lxml.etree as ET # nosec
from django.http import HttpRequest, HttpResponse
from django.utils.encoding import force_text
from django.views.generic import FormView
from django_otp.plugins.otp_totp.models import TOTPDevice
from lxml.etree import tostring # nosec
from qrcode import QRCode
from qrcode.image.svg import SvgFillImage
from structlog import get_logger
@ -35,7 +35,7 @@ class OTPTimeStageView(FormView, StageView):
"""Get QR Code SVG as string based on `device`"""
qr_code = QRCode(image_factory=SvgFillImage)
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:
user = self.executor.plan.context.get(PLAN_CONTEXT_PENDING_USER)