Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions preprocessors/content-categoriser/categoriser.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,9 @@ def categorise():
), 500

logging.pii(f"Graphic category JSON: {graphic_category}")
# create data json and verify the content-categoriser schema is respected
graphic_category_json = {"category": graphic_category}

# data schema validation
ok, _ = validator.check_data(graphic_category_json)
ok, _ = validator.check_data(graphic_category)
if not ok:
return jsonify("Invalid Preprocessor JSON format"), 500

Expand All @@ -101,7 +99,7 @@ def categorise():
"request_uuid": request_uuid,
"timestamp": int(timestamp),
"name": PREPROCESSOR_NAME,
"data": graphic_category_json
"data": graphic_category
}

# response envelope validation
Expand Down