Skip to content

Commit 3699305

Browse files
committed
cicdinfra type field is read only on form to prevent changes in usage on engagements
1 parent e3c28a5 commit 3699305

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

dojo/forms.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2653,6 +2653,11 @@ class Meta:
26532653
model = CICDInfrastructure
26542654
fields = ["name", "description", "url", "infrastructure_type"]
26552655

2656+
def __init__(self, *args, **kwargs):
2657+
super().__init__(*args, **kwargs)
2658+
if self.instance.pk:
2659+
self.fields["infrastructure_type"].disabled = True
2660+
26562661

26572662
class SLAConfigForm(forms.ModelForm):
26582663
def __init__(self, *args, **kwargs):

0 commit comments

Comments
 (0)