Beispiel #1
0
def test_receipt(request):
    form = forms.TestInstall(request.DATA)
    if not form.is_valid():
        return Response({'error_message': form.errors}, status=400)

    receipt_cef.log(request._request, None, 'sign', 'Test receipt signing')
    data = {
        'receipt':
        create_test_receipt(form.cleaned_data['root'],
                            form.cleaned_data['receipt_type'])
    }
    return Response(data, status=201)
Beispiel #2
0
def devhub_receipt(request):
    form = forms.TestInstall(request.POST)
    if form.is_valid():
        data = form.cleaned_data

        if data['receipt_type'] == 'none':
            return {'receipt': '', 'error': ''}

        receipt_cef.log(request, None, 'sign', 'Test receipt signing')
        receipt = create_test_receipt(data['root'], data['receipt_type'])
        return {'receipt': receipt, 'error': ''}

    return {'receipt': '', 'error': form.errors}
Beispiel #3
0
def devhub_install(request):
    return render(request, 'receipts/test_manifest.html',
                  {'form': forms.TestInstall()})