From 59cdf03aa03ee93afd8c456e527f9ebcb5c15d32 Mon Sep 17 00:00:00 2001 From: Aditya Bharadwaj Date: Thu, 13 Apr 2017 04:51:44 -0400 Subject: [PATCH] removed the unicode prefix in netrworks table on graphs detail tab --- applications/graphs/views.py | 1 + .../versions/755438125e7d_add_more_network_attributes.py | 2 +- templates/graph/graph_details_tab.html | 6 ++---- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/applications/graphs/views.py b/applications/graphs/views.py index f3523b17..929adbb0 100644 --- a/applications/graphs/views.py +++ b/applications/graphs/views.py @@ -115,6 +115,7 @@ def graph_page(request, graph_id): return redirect(request.get_full_path() + '?user_layout=' + context["default_layout_id"]) context['graph_json_string'] = json.dumps(context['graph']['graph_json']) + context['data'] = {k: json.dumps(v, encoding='ascii') for k,v in context['graph']['graph_json']['data'].items()} context['style_json_string'] = json.dumps(context['graph']['style_json']) context['description'] = context['graph']['graph_json']['data']['description'] if 'data' in context[ 'graph']['graph_json'] and 'description' in context['graph']['graph_json']['data'] else '' diff --git a/migration/versions/755438125e7d_add_more_network_attributes.py b/migration/versions/755438125e7d_add_more_network_attributes.py index 25e3dc58..c132420f 100644 --- a/migration/versions/755438125e7d_add_more_network_attributes.py +++ b/migration/versions/755438125e7d_add_more_network_attributes.py @@ -22,7 +22,7 @@ def upgrade(): graphspace = GraphSpace('adb@vt.edu', 'XXXX') - graphspace.set_api_host('localhost:8000') + # graphspace.set_api_host('localhost:8000') response = graphspace.get_public_graphs(limit=70) for graph in response['graphs']: graph_json = graph['graph_json'] diff --git a/templates/graph/graph_details_tab.html b/templates/graph/graph_details_tab.html index d3d27b01..de38caa3 100644 --- a/templates/graph/graph_details_tab.html +++ b/templates/graph/graph_details_tab.html @@ -17,8 +17,8 @@ Attribute Value - {% if 'data' in graph.graph_json %} - {% for k,v in graph.graph_json.data.items %} + + {% for k,v in data.items %} {% if k != 'description' %} {{ k|safe}} @@ -26,8 +26,6 @@ {% endif %} {% endfor %} - {% endif %} -