Skip to content

Commit

Permalink
Minor fix to method of unescaping JSON string. Switched to method tha…
Browse files Browse the repository at this point in the history
…t hopefully works in python 2 and 3.
  • Loading branch information
james-strauss-uwa committed Sep 6, 2019
1 parent 0e85c1c commit 4a1d069
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion dlg/dropmake/web/lg_web.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import sys
import threading
import time
import codecs

from bottle import route, request, get, static_file, template, redirect, \
response, HTTPResponse
Expand Down Expand Up @@ -350,7 +351,8 @@ def gen_pgt_post():

# Retrieve json data.
json_string = request.forms.get('json_data')
logical_graph = json.loads(json_string.decode('string-escape').strip('"'))
#logical_graph = json.loads(json_string.decode('string-escape').strip('"'))
logical_graph = json.loads(codecs.decode(json_string, 'unicode_escape').strip('"'))

try:
# Save graph
Expand Down

0 comments on commit 4a1d069

Please sign in to comment.