Beispiel #1
0
    def get(self, request):
        device = utils.get_unconfirmed_device(self.request.user)
        img = qrcode.make(device.config_url, image_factory=qrcode.image.svg.SvgImage)
        response = HttpResponse(content_type="image/svg+xml")
        img.save(response)

        return response
Beispiel #2
0
 def device(self):
     if self.request.method.lower() == "get":
         return utils.new_unconfirmed_device(self.request.user)
     else:
         return utils.get_unconfirmed_device(self.request.user)