Merge pull request #133 from pypeclub/bugfix/premiere_cleanup

Bugfix/premiere cleanup
This commit is contained in:
Milan Kolar 2020-05-12 16:24:31 +02:00 committed by GitHub
commit 13aece19b1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 22 deletions

View file

@ -70,24 +70,6 @@ class AvalonRestApi(RestApi):
_asset, identificator, _project_name
))
@RestApi.route("/publish/<asset_name>",
url_prefix="/premiere", methods="GET")
def publish(self, request):
"""
http://localhost:8021/premiere/publish/shot021?json_in=this/path/file_in.json&json_out=this/path/file_out.json
"""
asset_name = request.url_data["asset_name"]
query = request.query
data = request.request_data
output = {
"message": "Got your data. Thanks.",
"your_data": data,
"your_query": query,
"your_asset_is": asset_name
}
return CallbackResult(data=self.result_to_json(output))
def result_to_json(self, result):
""" Converts result of MongoDB query to dict without $oid (ObjectId)
keys with help of regex matching.

View file

@ -255,10 +255,9 @@ class Handler(http.server.SimpleHTTPRequestHandler):
try:
in_data = json.loads(in_data_str)
except Exception as e:
log.error("Invalid JSON recieved:")
log.error("-" * 80)
log.error(in_data_str)
log.error("-" * 80)
log.error("Invalid JSON recieved: \"{}\"".format(
str(in_data_str)
))
raise Exception("Invalid JSON recieved") from e
request_info = RequestInfo(