Skip to content

Commit f9e7476

Browse files
committed
fix(test definitions): remove unnecessary validation
1 parent 49ac837 commit f9e7476

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

testgen/ui/views/test_definitions.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,7 @@ def render_dynamic_attribute(attribute: str, container: DeltaGenerator):
669669
submit = bottom_left_column.button("Save")
670670

671671
if submit:
672-
if validate_form(test_scope, test_type, test_definition, column_name_label):
672+
if validate_form(test_scope, test_definition, column_name_label):
673673
if mode == "edit":
674674
test_definition["id"] = selected_test_def["id"]
675675
TestDefinition(**test_definition).save()
@@ -793,13 +793,7 @@ def copy_move_test_dialog(
793793
time.sleep(1)
794794
st.rerun()
795795

796-
def validate_form(test_scope, test_type, test_definition, column_name_label):
797-
if test_type == "Condition_Flag" and not test_definition["threshold_value"]:
798-
st.error("Threshold Error Count is a required field.")
799-
return False
800-
if not test_definition["test_type"]:
801-
st.error("Test Type is a required field.")
802-
return False
796+
def validate_form(test_scope, test_definition, column_name_label):
803797
if test_scope in ["column", "referential", "custom"] and not test_definition["column_name"]:
804798
st.error(f"{column_name_label} is a required field.")
805799
return False

0 commit comments

Comments
 (0)