mirror of
https://git.yoctoproject.org/poky
synced 2026-06-02 13:29:49 +00:00
bitbake: toaster: project page Implement front end feature to delete project
Add confirm modal and api calls to delete a project from the project dashboard. [YOCTO #6238] (Bitbake rev: e1cca28826dfa66d905dd4daf9964564c355207e) 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>
This commit is contained in:
committed by
Richard Purdie
parent
7ca44f53bc
commit
0d70606022
@@ -393,7 +393,7 @@ class XhrCustomRecipeId(View):
|
||||
""" Get Custom Image recipe or return an error response"""
|
||||
try:
|
||||
custom_recipe = \
|
||||
CustomImageRecipe.objects.get(pk=recipe_id)
|
||||
CustomImageRecipe.objects.get(pk=recipe_id)
|
||||
return custom_recipe, None
|
||||
|
||||
except CustomImageRecipe.DoesNotExist:
|
||||
@@ -418,8 +418,12 @@ class XhrCustomRecipeId(View):
|
||||
if error:
|
||||
return error
|
||||
|
||||
project = custom_recipe.project
|
||||
|
||||
custom_recipe.delete()
|
||||
return JsonResponse({"error": "ok"})
|
||||
return JsonResponse({"error": "ok",
|
||||
"gotoUrl": reverse("projectcustomimages",
|
||||
args=(project.pk,))})
|
||||
|
||||
|
||||
class XhrCustomRecipePackages(View):
|
||||
@@ -820,8 +824,11 @@ class XhrProject(View):
|
||||
|
||||
def delete(self, request, *args, **kwargs):
|
||||
try:
|
||||
Project.objects.get(kwargs['project_id']).delete()
|
||||
Project.objects.get(pk=kwargs['project_id']).delete()
|
||||
except Project.DoesNotExist:
|
||||
return error_response("Project %s does not exist" %
|
||||
kwargs['project_id'])
|
||||
return JsonResponse({"error": "ok"})
|
||||
return JsonResponse({
|
||||
"error": "ok",
|
||||
"gotoUrl": reverse("all-projects", args=[])
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user