From 6b47ec9b2c00eb45d38c489930a15f9060872206 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 11 May 2020 16:37:00 +0200 Subject: [PATCH 1/2] Removed publish method from avalon_apps rest api --- pype/avalon_apps/rest_api.py | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/pype/avalon_apps/rest_api.py b/pype/avalon_apps/rest_api.py index 1267ee3992..a552d70907 100644 --- a/pype/avalon_apps/rest_api.py +++ b/pype/avalon_apps/rest_api.py @@ -70,24 +70,6 @@ class AvalonRestApi(RestApi): _asset, identificator, _project_name )) - @RestApi.route("/publish/", - 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. From 165177834d41656ba6436b67d472548cad1dc4fe Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 11 May 2020 16:38:34 +0200 Subject: [PATCH 2/2] rest api handler does not log 4 error records at once --- pype/services/rest_api/lib/handler.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pype/services/rest_api/lib/handler.py b/pype/services/rest_api/lib/handler.py index dc94808237..fc4410a0bc 100644 --- a/pype/services/rest_api/lib/handler.py +++ b/pype/services/rest_api/lib/handler.py @@ -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(