From a505453e971828458795661a2ea9107638292e2d Mon Sep 17 00:00:00 2001 From: AlexCami1902 Date: Mon, 12 May 2025 11:27:53 +1000 Subject: [PATCH] Update inputs.py Added data validation to all of the inputs for the team selection and match location that the teams and location cannot be blank; this makes sure that either way, some aspect of a team is entered. This also helps with naming later on, as in theory the teams should have different names. Signed-off-by: AlexCami1902 --- inputs.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/inputs.py b/inputs.py index 663daee..260ce2e 100644 --- a/inputs.py +++ b/inputs.py @@ -121,12 +121,15 @@ def pick_away_colour(): current_picker_target = "away" -def submit_form(): +def submit_form(): home_team = input_boxes[0].text away_team = input_boxes[1].text match_location = input_boxes[2].text - varpass(home_team, away_team, match_location) - import main + if home_team == "" or away_team == "" or match_location == "": + return + else: + varpass(home_team, away_team, match_location) + import main # Function to draw text def draw_text(text, font, colour, surface, x, y):