|
|
@@ -56,8 +56,8 @@ class ModuleCommonForm(forms.Form):
|
|
|
def clean(self):
|
|
|
super().clean()
|
|
|
|
|
|
- replicate_components = self.cleaned_data.get("replicate_components")
|
|
|
- adopt_components = self.cleaned_data.get("adopt_components")
|
|
|
+ replicate_components = self.cleaned_data.get('replicate_components')
|
|
|
+ adopt_components = self.cleaned_data.get('adopt_components')
|
|
|
device = self.cleaned_data.get('device')
|
|
|
module_type = self.cleaned_data.get('module_type')
|
|
|
module_bay = self.cleaned_data.get('module_bay')
|
|
|
@@ -65,8 +65,9 @@ class ModuleCommonForm(forms.Form):
|
|
|
if adopt_components:
|
|
|
self.instance._adopt_components = True
|
|
|
|
|
|
- # Bail out if we are not installing a new module or if we are not replicating components
|
|
|
- if self.instance.pk or not replicate_components:
|
|
|
+ # Bail out if we are not installing a new module or if we are not replicating components (or if
|
|
|
+ # validation has already failed)
|
|
|
+ if self.errors or self.instance.pk or not replicate_components:
|
|
|
self.instance._disable_replication = True
|
|
|
return
|
|
|
|