stages/otp_time: show OTP URI as aria-label

This commit is contained in:
Jens Langhammer 2020-09-25 19:03:12 +02:00
parent d278acb83b
commit 74d3cfbba0
1 changed files with 3 additions and 1 deletions

View File

@ -35,7 +35,9 @@ 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_str(tostring(qr_code.make_image().get_image()))
svg_image = tostring(qr_code.make_image().get_image())
sr_wrapper = f'<div aria-label="{device.config_url}">{force_str(svg_image)}</div>'
return sr_wrapper
def get(self, request: HttpRequest, *args, **kwargs) -> HttpResponse:
user = self.executor.plan.context.get(PLAN_CONTEXT_PENDING_USER)