summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/toastergui/views.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/toaster/toastergui/views.py')
-rwxr-xr-xbitbake/lib/toaster/toastergui/views.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py
index ec055d392a..dd430805b1 100755
--- a/bitbake/lib/toaster/toastergui/views.py
+++ b/bitbake/lib/toaster/toastergui/views.py
@@ -2253,6 +2253,8 @@ if toastermain.settings.MANAGED:
2253 not request.POST.has_key('project_id')): 2253 not request.POST.has_key('project_id')):
2254 return HttpResponse(jsonfilter({"error": "Missing parameters; requires vcs_url, name, git_ref and project_id"}), content_type = "application/json") 2254 return HttpResponse(jsonfilter({"error": "Missing parameters; requires vcs_url, name, git_ref and project_id"}), content_type = "application/json")
2255 2255
2256 layers_added = [];
2257
2256 # Rudimentary check for any possible html tags 2258 # Rudimentary check for any possible html tags
2257 if "<" in request.POST: 2259 if "<" in request.POST:
2258 return HttpResponse(jsonfilter({"error": "Invalid character <"}), content_type = "application/json") 2260 return HttpResponse(jsonfilter({"error": "Invalid character <"}), content_type = "application/json")
@@ -2315,9 +2317,12 @@ if toastermain.settings.MANAGED:
2315 # if the project now contains the exact 2317 # if the project now contains the exact
2316 # dependency already (like modified on another page) 2318 # dependency already (like modified on another page)
2317 try: 2319 try:
2318 ProjectLayer.objects.get_or_create(layercommit=layer_dep_obj, project=prj) 2320 prj_layer, prj_layer_created = ProjectLayer.objects.get_or_create(layercommit=layer_dep_obj, project=prj)
2319 except: 2321 except:
2320 pass 2322 continue
2323
2324 if prj_layer_created:
2325 layers_added.append(Layer.objects.get(id=layer_dep_obj.layer_id).name)
2321 2326
2322 2327
2323 # If an old layer version exists in our project then remove it 2328 # If an old layer version exists in our project then remove it
@@ -2337,7 +2342,7 @@ if toastermain.settings.MANAGED:
2337 return HttpResponse(jsonfilter({"error": "Uncaught error: Could not create layer version"}), content_type = "application/json") 2342 return HttpResponse(jsonfilter({"error": "Uncaught error: Could not create layer version"}), content_type = "application/json")
2338 2343
2339 2344
2340 return HttpResponse(jsonfilter({"error": "ok"}), content_type = "application/json") 2345 return HttpResponse(jsonfilter({"error": "ok", "layers_added": layers_added}), content_type = "application/json")
2341 2346
2342 2347
2343 2348