From 3f0b4d1e961ceaac82de3a3ca20b75692e6e9822 Mon Sep 17 00:00:00 2001 From: Julius Osokinas Date: Sat, 3 Nov 2018 14:35:55 +0000 Subject: [PATCH] Revert "Print various helpers to help debug on Travis" This reverts commit fbb08476356ee2809ed06a7348284c221369b93e. --- geokey_sapelli/views.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/geokey_sapelli/views.py b/geokey_sapelli/views.py index 83387a5..e7202e2 100755 --- a/geokey_sapelli/views.py +++ b/geokey_sapelli/views.py @@ -754,14 +754,12 @@ def get(self, request, project_id): try: # Try getting previously generated link/token: qr_link = SAPDownloadQRLink.objects.filter(access_token__user=request.user, sapelli_project=sapelli_project).latest('access_token__expires') except BaseException, e: - print 'No QA link', e pass if qr_link is None or qr_link.access_token.is_expired(): if (qr_link is not None): qr_link.access_token.delete() # qr_link will be deleted as well # Generate new access token (valid for 1 day): qr_link = SAPDownloadQRLink.create(user=request.user, sapelli_project=sapelli_project, days_valid=1) - print 'QR Link', qr_link # Generate download url: sap_download_url = ( request.build_absolute_uri(reverse('geokey_sapelli:sap_download_api', kwargs={'project_id': project_id})) + @@ -772,25 +770,20 @@ def get(self, request, project_id): error_correction=qrcode.constants.ERROR_CORRECT_M, box_size=5, border=0) - print 'QR', qr qr.add_data(sap_download_url) qr.make(fit=True) img_buffer = StringIO() qr.make_image().save(img_buffer, "PNG") - print 'Made image' # Grab img file from in-memory, make response with correct MIME-type response = HttpResponse(img_buffer.getvalue(), content_type='image/png') # ..and correct content-disposition - print 'Have response' response['Content-Disposition'] = 'attachment; filename=%s' % request.path[request.path.rfind('/') + 1:] # Add additional info as response headers: response['X-QR-URL'] = sap_download_url response['X-QR-Access-Token'] = qr_link.access_token.token response['X-QR-Access-Token-Expires'] = qr_link.access_token.expires.isoformat() - print response return response except BaseException, e: - print e return Response({'error': str(e)}) @handle_exceptions_for_ajax