Commit fb882d28 by John Jarvis Committed by Carlos Andrés Rocha

cert.state->cert.status

parent 8e5d6bd4
...@@ -44,19 +44,19 @@ def update_certificate(request): ...@@ -44,19 +44,19 @@ def update_certificate(request):
if 'error' in xqueue_body: if 'error' in xqueue_body:
cert.status = status.error cert.status = status.error
else: else:
if cert.state in [status.generating, status.regenerating]: if cert.status in [status.generating, status.regenerating]:
cert.download_uuid = xqueue_body['download_uuid'] cert.download_uuid = xqueue_body['download_uuid']
cert.verify_uuid = xqueue_body['verify_uuid'] cert.verify_uuid = xqueue_body['verify_uuid']
cert.download_url = xqueue_body['url'] cert.download_url = xqueue_body['url']
cert.status = status.downloadable cert.status = status.downloadable
elif cert.state in [status.deleting]: elif cert.status in [status.deleting]:
cert.status = status.deleted cert.status = status.deleted
else: else:
logger.critical('Invalid state for cert update: {0}'.format( logger.critical('Invalid state for cert update: {0}'.format(
cert.state)) cert.status))
return HttpResponse(json.dumps({ return HttpResponse(json.dumps({
'return_code': 1, 'return_code': 1,
'content': 'invalid cert state'}), 'content': 'invalid cert status'}),
mimetype='application/json') mimetype='application/json')
cert.save() cert.save()
return HttpResponse(json.dumps({'return_code': 0}), return HttpResponse(json.dumps({'return_code': 0}),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment