fix bug that caused flavors to be permanently deleted
authorTony Mack <tmack@tux.cs.princeton.edu>
Mon, 15 Dec 2014 17:37:59 +0000 (12:37 -0500)
committerTony Mack <tmack@tux.cs.princeton.edu>
Mon, 15 Dec 2014 17:37:59 +0000 (12:37 -0500)
planetstack/core/admin.py

index 7fa537a..be75f75 100644 (file)
@@ -609,7 +609,7 @@ class DeploymentAdminForm(forms.ModelForm):
         # so well handle that manually here
         for flavor in deployment.flavors.all():
             if getattr(flavor, 'name') not in self.cleaned_data['flavors']:
-                flavor.delete()
+                deployment.flavors.remove(flavor)
         for flavor in self.cleaned_data['flavors']:
             if flavor not in deployment.flavors.all():
                 flavor.deployments.add(deployment)