fix Chosen Sites empty in Deployment Admin
Scott Baker [Wed, 21 Jan 2015 01:59:55 +0000 (17:59 -0800)]
planetstack/core/admin.py

index 9fba05c..054871f 100644 (file)
@@ -542,7 +542,7 @@ class DeploymentAdminForm(forms.ModelForm):
       self.fields['accessControl'].initial = "allow site " + request.user.site.name
 
       if self.instance and self.instance.pk:
-        self.fields['sites'].initial = [x for x in self.instance.sitedeployments.all()]
+        self.fields['sites'].initial = [x.site for x in self.instance.sitedeployments.all()]
         self.fields['images'].initial = [x.image for x in self.instance.imagedeployments.all()]
         self.fields['flavors'].initial = self.instance.flavors.all()