Commit 8a4660b2 authored by Matthias's avatar Matthias
Browse files

change writejobresultstodrupal to receive data in post-body

parent 622395bd
Pipeline #22987 passed with stages
in 2 minutes and 49 seconds
from flask_restful import Resource
from flask_restful import Resource, request
from import_api_app.helpers.Drupal import write_results
from import_api_app.helpers.Error import ImportApiError
class WriteJobResultToDrupal(Resource):
def post(self, job_log_drupal_uuid, report):
def post(self, job_log_drupal_uuid):
"""
Write the job summary to Drupal job log (in field_summary)
---
......@@ -18,12 +18,16 @@ class WriteJobResultToDrupal(Resource):
description: job log uuid
default: 2b07341f-3b99-408c-a729-6e18dd77c6d5
type: string
- in: path
name: report
- in: body
name: body
required: true
description: The report that will be written
default: This was a huge success !
type: string
schema:
id: report
properties:
report:
type: string
example: reporting json...
description: The aggregated report of an import
responses:
200:
description: It was successful
......@@ -33,6 +37,7 @@ class WriteJobResultToDrupal(Resource):
description: There was a problem
"""
try:
report = request.json['report']
return write_results(job_log_drupal_uuid, report)
except ImportApiError as e:
return {'error': e.message}, 500
Supports Markdown
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