mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 16:34:53 +01:00
Merge pull request #133 from pypeclub/bugfix/premiere_cleanup
Bugfix/premiere cleanup
This commit is contained in:
commit
13aece19b1
2 changed files with 3 additions and 22 deletions
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue