summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/toastergui/views.py
diff options
context:
space:
mode:
authorMichael Wood <michael.g.wood@intel.com>2015-07-31 15:09:07 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-08-01 11:26:11 +0100
commit1b13222e1c031d29419781e41956bedf643ebd74 (patch)
treedb1bc8ea9fa2ea54d888c7cfe5d356c025fb5ffa /bitbake/lib/toaster/toastergui/views.py
parentdf999d2ac162a5be3a65ac4ce771a7466aab2bdb (diff)
downloadpoky-1b13222e1c031d29419781e41956bedf643ebd74.tar.gz
bitbake: toastergui: Standardise the layer object property layerdetailurl
To be able to use the utility functions in libtoaster we need to have a single property name for the value that represents the url for the layer details in the layer object. (Bitbake rev: 4d64fd0d1236d342b29537f601a68cd23a8255ea) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/toastergui/views.py')
-rwxr-xr-xbitbake/lib/toaster/toastergui/views.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py
index 9c63aae251..9e89714b9c 100755
--- a/bitbake/lib/toaster/toastergui/views.py
+++ b/bitbake/lib/toaster/toastergui/views.py
@@ -2434,7 +2434,8 @@ if True:
2434 continue 2434 continue
2435 2435
2436 if prj_layer_created: 2436 if prj_layer_created:
2437 layers_added.append({'id': layer_dep_obj.id, 'name': Layer.objects.get(id=layer_dep_obj.layer_id).name}) 2437 layerdepdetailurl = reverse('layerdetails', args=(prj.id, layer_dep_obj.pk))
2438 layers_added.append({'id': layer_dep_obj.id, 'name': Layer.objects.get(id=layer_dep_obj.layer_id).name, 'layerdetailurl': layerdepdetailurl })
2438 2439
2439 2440
2440 # If an old layer version exists in our project then remove it 2441 # If an old layer version exists in our project then remove it
@@ -2453,8 +2454,17 @@ if True:
2453 2454
2454 return HttpResponse(jsonfilter({"error": "Uncaught error: Could not create layer version"}), content_type = "application/json") 2455 return HttpResponse(jsonfilter({"error": "Uncaught error: Could not create layer version"}), content_type = "application/json")
2455 2456
2457 layerdetailurl = reverse('layerdetails', args=(prj.id, layer_version.pk))
2456 2458
2457 return HttpResponse(jsonfilter({"error": "ok", "imported_layer" : { "name" : layer.name, "id": layer_version.id }, "deps_added": layers_added }), content_type = "application/json") 2459 json_response = {"error": "ok",
2460 "imported_layer" : {
2461 "name" : layer.name,
2462 "id": layer_version.id,
2463 "layerdetailurl": layerdetailurl,
2464 },
2465 "deps_added": layers_added }
2466
2467 return HttpResponse(jsonfilter(json_response), content_type = "application/json")
2458 2468
2459 def xhr_updatelayer(request): 2469 def xhr_updatelayer(request):
2460 2470