diff options
| -rwxr-xr-x | bitbake/lib/toaster/toastergui/views.py | 28 | ||||
| -rw-r--r-- | bitbake/lib/toaster/toastermain/settings.py | 2 | ||||
| -rw-r--r-- | bitbake/lib/toaster/toastermain/urls.py | 2 |
3 files changed, 16 insertions, 16 deletions
diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py index b7c674a076..82cc52ead8 100755 --- a/bitbake/lib/toaster/toastergui/views.py +++ b/bitbake/lib/toaster/toastergui/views.py | |||
| @@ -2235,10 +2235,10 @@ if True: | |||
| 2235 | 2235 | ||
| 2236 | 2236 | ||
| 2237 | def xhr_importlayer(request): | 2237 | def xhr_importlayer(request): |
| 2238 | if (not request.POST.has_key('vcs_url') or | 2238 | if ('vcs_url' not in request.POST or |
| 2239 | not request.POST.has_key('name') or | 2239 | 'name' not in request.POST or |
| 2240 | not request.POST.has_key('git_ref') or | 2240 | 'git_ref' not in request.POST or |
| 2241 | not request.POST.has_key('project_id')): | 2241 | 'project_id' not in request.POST): |
| 2242 | return HttpResponse(jsonfilter({"error": "Missing parameters; requires vcs_url, name, git_ref and project_id"}), content_type = "application/json") | 2242 | return HttpResponse(jsonfilter({"error": "Missing parameters; requires vcs_url, name, git_ref and project_id"}), content_type = "application/json") |
| 2243 | 2243 | ||
| 2244 | layers_added = []; | 2244 | layers_added = []; |
| @@ -2294,7 +2294,7 @@ if True: | |||
| 2294 | layer_version.save() | 2294 | layer_version.save() |
| 2295 | 2295 | ||
| 2296 | # Add the dependencies specified for this new layer | 2296 | # Add the dependencies specified for this new layer |
| 2297 | if (post_data.has_key("layer_deps") and | 2297 | if ('layer_deps' in post_data and |
| 2298 | version_created and | 2298 | version_created and |
| 2299 | len(post_data["layer_deps"]) > 0): | 2299 | len(post_data["layer_deps"]) > 0): |
| 2300 | for layer_dep_id in post_data["layer_deps"].split(","): | 2300 | for layer_dep_id in post_data["layer_deps"].split(","): |
| @@ -2348,7 +2348,7 @@ if True: | |||
| 2348 | def error_response(error): | 2348 | def error_response(error): |
| 2349 | return HttpResponse(jsonfilter({"error": error}), content_type = "application/json") | 2349 | return HttpResponse(jsonfilter({"error": error}), content_type = "application/json") |
| 2350 | 2350 | ||
| 2351 | if not request.POST.has_key("layer_version_id"): | 2351 | if "layer_version_id" not in request.POST: |
| 2352 | return error_response("Please specify a layer version id") | 2352 | return error_response("Please specify a layer version id") |
| 2353 | try: | 2353 | try: |
| 2354 | layer_version_id = request.POST["layer_version_id"] | 2354 | layer_version_id = request.POST["layer_version_id"] |
| @@ -2357,26 +2357,26 @@ if True: | |||
| 2357 | return error_response("Cannot find layer to update") | 2357 | return error_response("Cannot find layer to update") |
| 2358 | 2358 | ||
| 2359 | 2359 | ||
| 2360 | if request.POST.has_key("vcs_url"): | 2360 | if "vcs_url" in request.POST: |
| 2361 | layer_version.layer.vcs_url = request.POST["vcs_url"] | 2361 | layer_version.layer.vcs_url = request.POST["vcs_url"] |
| 2362 | if request.POST.has_key("dirpath"): | 2362 | if "dirpath" in request.POST: |
| 2363 | layer_version.dirpath = request.POST["dirpath"] | 2363 | layer_version.dirpath = request.POST["dirpath"] |
| 2364 | if request.POST.has_key("commit"): | 2364 | if "commit" in request.POST: |
| 2365 | layer_version.commit = request.POST["commit"] | 2365 | layer_version.commit = request.POST["commit"] |
| 2366 | if request.POST.has_key("up_branch"): | 2366 | if "up_branch" in request.POST: |
| 2367 | layer_version.up_branch_id = int(request.POST["up_branch"]) | 2367 | layer_version.up_branch_id = int(request.POST["up_branch"]) |
| 2368 | 2368 | ||
| 2369 | if request.POST.has_key("add_dep"): | 2369 | if "add_dep" in request.POST: |
| 2370 | lvd = LayerVersionDependency(layer_version=layer_version, depends_on_id=request.POST["add_dep"]) | 2370 | lvd = LayerVersionDependency(layer_version=layer_version, depends_on_id=request.POST["add_dep"]) |
| 2371 | lvd.save() | 2371 | lvd.save() |
| 2372 | 2372 | ||
| 2373 | if request.POST.has_key("rm_dep"): | 2373 | if "rm_dep" in request.POST: |
| 2374 | rm_dep = LayerVersionDependency.objects.get(layer_version=layer_version, depends_on_id=request.POST["rm_dep"]) | 2374 | rm_dep = LayerVersionDependency.objects.get(layer_version=layer_version, depends_on_id=request.POST["rm_dep"]) |
| 2375 | rm_dep.delete() | 2375 | rm_dep.delete() |
| 2376 | 2376 | ||
| 2377 | if request.POST.has_key("summary"): | 2377 | if "summary" in request.POST: |
| 2378 | layer_version.layer.summary = request.POST["summary"] | 2378 | layer_version.layer.summary = request.POST["summary"] |
| 2379 | if request.POST.has_key("description"): | 2379 | if "description" in request.POST: |
| 2380 | layer_version.layer.description = request.POST["description"] | 2380 | layer_version.layer.description = request.POST["description"] |
| 2381 | 2381 | ||
| 2382 | try: | 2382 | try: |
diff --git a/bitbake/lib/toaster/toastermain/settings.py b/bitbake/lib/toaster/toastermain/settings.py index 8662f393a9..78702fa59e 100644 --- a/bitbake/lib/toaster/toastermain/settings.py +++ b/bitbake/lib/toaster/toastermain/settings.py | |||
| @@ -321,7 +321,7 @@ currentdir = os.path.dirname(__file__) | |||
| 321 | for t in os.walk(os.path.dirname(currentdir)): | 321 | for t in os.walk(os.path.dirname(currentdir)): |
| 322 | modulename = os.path.basename(t[0]) | 322 | modulename = os.path.basename(t[0]) |
| 323 | #if we have a virtualenv skip it to avoid incorrect imports | 323 | #if we have a virtualenv skip it to avoid incorrect imports |
| 324 | if os.environ.has_key('VIRTUAL_ENV') and os.environ['VIRTUAL_ENV'] in t[0]: | 324 | if 'VIRTUAL_ENV' in os.environ and os.environ['VIRTUAL_ENV'] in t[0]: |
| 325 | continue | 325 | continue |
| 326 | 326 | ||
| 327 | if ("views.py" in t[2] or "models.py" in t[2]) and not modulename in INSTALLED_APPS: | 327 | if ("views.py" in t[2] or "models.py" in t[2]) and not modulename in INSTALLED_APPS: |
diff --git a/bitbake/lib/toaster/toastermain/urls.py b/bitbake/lib/toaster/toastermain/urls.py index 530a42ffab..1f8599edc3 100644 --- a/bitbake/lib/toaster/toastermain/urls.py +++ b/bitbake/lib/toaster/toastermain/urls.py | |||
| @@ -71,7 +71,7 @@ import os | |||
| 71 | currentdir = os.path.dirname(__file__) | 71 | currentdir = os.path.dirname(__file__) |
| 72 | for t in os.walk(os.path.dirname(currentdir)): | 72 | for t in os.walk(os.path.dirname(currentdir)): |
| 73 | #if we have a virtualenv skip it to avoid incorrect imports | 73 | #if we have a virtualenv skip it to avoid incorrect imports |
| 74 | if os.environ.has_key('VIRTUAL_ENV') and os.environ['VIRTUAL_ENV'] in t[0]: | 74 | if 'VIRTUAL_ENV' in os.environ and os.environ['VIRTUAL_ENV'] in t[0]: |
| 75 | continue | 75 | continue |
| 76 | 76 | ||
| 77 | if "urls.py" in t[2] and t[0] != currentdir: | 77 | if "urls.py" in t[2] and t[0] != currentdir: |
