From 9f73f5e49e0facb479a6013bbac294466a34634f Mon Sep 17 00:00:00 2001 From: RJAK11 Date: Fri, 10 Jan 2025 11:19:09 -0500 Subject: [PATCH] fix(nimbus): Make name field in new UI required Because - Submitting a form with an empty name field in the new Nimbus UI causes a 500 error. This commit - Adds validation to ensure the name field is required and prevents submission with an empty value Fixes #12016 --- experimenter/experimenter/nimbus_ui_new/tests/test_forms.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/experimenter/experimenter/nimbus_ui_new/tests/test_forms.py b/experimenter/experimenter/nimbus_ui_new/tests/test_forms.py index fbcf93b504..77c92a9a73 100644 --- a/experimenter/experimenter/nimbus_ui_new/tests/test_forms.py +++ b/experimenter/experimenter/nimbus_ui_new/tests/test_forms.py @@ -383,6 +383,7 @@ def test_name_field_is_required(self): documentation_link = NimbusDocumentationLinkFactory.create() form_data = { + "name": "", "hypothesis": "new hypothesis", "risk_brand": True, "risk_message": True, @@ -402,6 +403,7 @@ def test_name_field_is_required(self): form = OverviewForm(data=form_data) self.assertFalse(form.is_valid()) + self.assertIn("name", form.errors) class TestDocumentationLinkCreateForm(RequestFormTestCase):