Skip to content

Commit

Permalink
Merge pull request #4 from uwcirg/feature/map-on-request-only
Browse files Browse the repository at this point in the history
Only include `scrub_map` when requested via `map` query string.
  • Loading branch information
pbugni authored Feb 24, 2022
2 parents 3591102 + 0828dec commit f95e9de
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion gwen/views.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import requests
from flask import Blueprint, abort, current_app, jsonify
from flask import Blueprint, abort, current_app, jsonify, request
from flask.json import JSONEncoder
from gwen.models.scrub import scrub_input

Expand Down Expand Up @@ -50,4 +50,9 @@ def scrub_events():
response.raise_for_status()

clean_data, scrub_map = scrub_input(response.json())

# Hide the scrub_map unless specifically requested
if "map" not in request.args:
return jsonify(clean_data)

return jsonify(clean_data=clean_data, scrub_map=scrub_map)

0 comments on commit f95e9de

Please sign in to comment.