fix manyToMany error when creating deployment
diff --git a/planetstack/core/admin.py b/planetstack/core/admin.py
index 11a2c59..a77be5b 100644
--- a/planetstack/core/admin.py
+++ b/planetstack/core/admin.py
@@ -527,10 +527,10 @@
def save(self, commit=True):
deployment = super(DeploymentAdminForm, self).save(commit=False)
- deployment.flavors = self.cleaned_data['flavors']
-
if commit:
deployment.save()
+ # this has to be done after save() if/when a deployment is first created
+ deployment.flavors = self.cleaned_data['flavors']
if deployment.pk:
# save_m2m() doesn't seem to work with 'through' relations. So we