Conversation
Contributor
Author
|
Merge after #15960 |
yashikakhurana
requested changes
Jun 18, 2026
Comment on lines
+109
to
+130
| class NimbusExperimentCreateForm(NimbusChangeLogFormMixin, forms.ModelForm): | ||
| owner = forms.ModelChoiceField( | ||
| User.objects.all(), | ||
| widget=forms.widgets.HiddenInput(), | ||
| ) | ||
| name = forms.CharField( | ||
| label="", | ||
| widget=forms.widgets.TextInput( | ||
| attrs={ | ||
| "placeholder": "Public Name", | ||
| } | ||
| ), | ||
| ) | ||
| slug = forms.CharField( | ||
| required=False, | ||
| widget=forms.widgets.HiddenInput(), | ||
| ) | ||
| hypothesis = forms.CharField( | ||
| label="", | ||
| widget=forms.widgets.Textarea(), | ||
| initial=NimbusUIConstants.HYPOTHESIS_PLACEHOLDER, | ||
| ) |
Contributor
There was a problem hiding this comment.
why are we adding this form here? I don't think we have added the functionality to create in the design yet
Contributor
Author
There was a problem hiding this comment.
NimbusRolloutDetailView inherits from NimbusExperimentViewMixin and CloneExperimentFormMixin which both use those forms
Comment on lines
+188
to
+215
| class NimbusExperimentSidebarCloneForm(NimbusChangeLogFormMixin, forms.ModelForm): | ||
| owner = forms.ModelChoiceField( | ||
| User.objects.all(), | ||
| widget=forms.widgets.HiddenInput(), | ||
| ) | ||
| name = forms.CharField( | ||
| required=True, widget=forms.TextInput(attrs={"class": "form-control"}) | ||
| ) | ||
| slug = forms.CharField( | ||
| required=False, | ||
| widget=forms.widgets.HiddenInput(), | ||
| ) | ||
|
|
||
| class Meta: | ||
| model = NimbusExperiment | ||
| fields = ["owner", "name", "slug"] | ||
|
|
||
| def clean_name(self): | ||
| name = self.cleaned_data["name"] | ||
| slug = slugify(name) | ||
| if not slug: | ||
| raise forms.ValidationError(NimbusUIConstants.ERROR_NAME_INVALID) | ||
| if NimbusExperiment.objects.filter(slug=slug).exists(): | ||
| raise forms.ValidationError( | ||
| NimbusUIConstants.ERROR_NAME_MAPS_TO_EXISTING_SLUG | ||
| ) | ||
| return name | ||
|
|
Contributor
There was a problem hiding this comment.
same this not using yet
yashikakhurana
approved these changes
Jun 18, 2026
yashikakhurana
left a comment
Contributor
There was a problem hiding this comment.
sounds good lets merged this, thank you @moibra05
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Because
This commit
Fixes #15949