Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _validate_id(self, id_type: str):
print("[bold blue]Validating URL[/bold blue]")
if id_type == "participant":
url = f"{base_api_url}/participants/{self.ui.lineEditParticipantID.text()}"
valid_url = extralife_io.validate_url(url)
if valid_url:
message_box = QMessageBox.information(self, "Participant ID Validation",
f"Able to reach {url}. Participant ID is valid.")
else:
message_box = QMessageBox.warning(self, "Participant ID Validation",
f"Could not reach {url}. Participant ID may be invalid.")
elif id_type == "team":
url = f"{base_api_url}/teams/{self.ui.lineEditTeamID.text()}"
valid_url = extralife_io.validate_url(url)
if valid_url:
message_box = QMessageBox.information(self, "Team ID Validation",
f"Able to reach {url}. Team ID is valid.")
else:
message_box = QMessageBox.warning(self, "Team ID Validation",
f"Could not reach {url}. Team ID may be invalid.")
def _validate_id(self, id_type: str):
print("[bold blue]Validating URL[/bold blue]")
if id_type == "participant":
url = f"{base_api_url}/participants/{self.ui.lineEditParticipantID.text()}"
valid_url = extralife_io.validate_url(url)
if valid_url:
message_box = QMessageBox.information(self, "Participant ID Validation",
f"Able to reach {url}. Participant ID is valid.")
else:
message_box = QMessageBox.warning(self, "Participant ID Validation",
f"Could not reach {url}. Participant ID may be invalid.")
elif id_type == "team":
url = f"{base_api_url}/teams/{self.ui.lineEditTeamID.text()}"
valid_url = extralife_io.validate_url(url)
if valid_url:
message_box = QMessageBox.information(self, "Team ID Validation",
f"Able to reach {url}. Team ID is valid.")
else:
message_box = QMessageBox.warning(self, "Team ID Validation",
f"Could not reach {url}. Team ID may be invalid.")