def POST_v1_compile(): """Enqueue a compile job. """ data = request.get_json(force=True) if not data: return error("Invalid JSON data!") if '.' in data['keyboard'] or '/' in data['keymap']: return error("F**k off hacker.", 422) job = compile_firmware.delay(data['keyboard'], data['keymap'], data['layout'], data['layers']) return jsonify({'enqueued': True, 'job_id': job.id})