Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion experimenter/experimenter/nimbus_ui/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -829,8 +829,8 @@ def clean(self):

@transaction.atomic
def save(self, *args, **kwargs):
experiment = super().save(*args, **kwargs)
self.branches.save()
experiment = super().save(*args, **kwargs)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's even more cleaner

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only the cleanest 🙏 🧹


if experiment.is_rollout:
branches = experiment.branches.all()
Expand Down
12 changes: 12 additions & 0 deletions experimenter/experimenter/nimbus_ui/tests/test_forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -3226,6 +3226,18 @@ def test_branches_form_saves_branches(self):

changelog = experiment.changes.get()
self.assertIn("updated branches", changelog.message)
changelog_branches = changelog.experiment_data["branches"]
changelog_fv_values = [
fv["value"] for b in changelog_branches for fv in b["feature_values"]
]
self.assertIn(
json.dumps({"control-feature1-key": "control-feature-1-value"}),
changelog_fv_values,
)
self.assertIn(
json.dumps({"treatment-feature-1-key": "treatment-feature-1-value"}),
changelog_fv_values,
)

def test_branches_form_saves_added_feature_config(self):
application = NimbusExperiment.Application.DESKTOP
Expand Down
Loading