diff options
| -rw-r--r-- | bitbake/lib/toaster/toastergui/api.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/bitbake/lib/toaster/toastergui/api.py b/bitbake/lib/toaster/toastergui/api.py index a06ffc00dc..e367bd910e 100644 --- a/bitbake/lib/toaster/toastergui/api.py +++ b/bitbake/lib/toaster/toastergui/api.py | |||
| @@ -227,7 +227,7 @@ class XhrSetDefaultImageUrl(View): | |||
| 227 | # same logical name | 227 | # same logical name |
| 228 | # * Each project that uses a layer will have its own | 228 | # * Each project that uses a layer will have its own |
| 229 | # LayerVersion and Project Layer for it | 229 | # LayerVersion and Project Layer for it |
| 230 | # * During the Paroject delete process, when the last | 230 | # * During the Project delete process, when the last |
| 231 | # LayerVersion for a 'local_source_dir' layer is deleted | 231 | # LayerVersion for a 'local_source_dir' layer is deleted |
| 232 | # then the Layer record is deleted to remove orphans | 232 | # then the Layer record is deleted to remove orphans |
| 233 | # | 233 | # |
| @@ -457,15 +457,18 @@ class XhrLayer(View): | |||
| 457 | 'layerdetailurl': | 457 | 'layerdetailurl': |
| 458 | layer_dep.get_detailspage_url(project.pk)}) | 458 | layer_dep.get_detailspage_url(project.pk)}) |
| 459 | 459 | ||
| 460 | # Scan the layer's content and update components | 460 | # Only scan_layer_content if layer is local |
| 461 | scan_layer_content(layer,layer_version) | 461 | if layer_data.get('local_source_dir', None): |
| 462 | # Scan the layer's content and update components | ||
| 463 | scan_layer_content(layer,layer_version) | ||
| 462 | 464 | ||
| 463 | except Layer_Version.DoesNotExist: | 465 | except Layer_Version.DoesNotExist: |
| 464 | return error_response("layer-dep-not-found") | 466 | return error_response("layer-dep-not-found") |
| 465 | except Project.DoesNotExist: | 467 | except Project.DoesNotExist: |
| 466 | return error_response("project-not-found") | 468 | return error_response("project-not-found") |
| 467 | except KeyError: | 469 | except KeyError as e: |
| 468 | return error_response("incorrect-parameters") | 470 | _log("KeyError: %s" % e) |
| 471 | return error_response(f"incorrect-parameters") | ||
| 469 | 472 | ||
| 470 | return JsonResponse({'error': "ok", | 473 | return JsonResponse({'error': "ok", |
| 471 | 'imported_layer': { | 474 | 'imported_layer': { |
