How to use the eldonationtracker.extralife_io.validate_url function in eldonationtracker

To help you get started, we’ve selected a few eldonationtracker examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github djotaku / ELDonationTracker / eldonationtracker / call_settings.py View on Github external
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.")
github djotaku / ELDonationTracker / eldonationtracker / call_settings.py View on Github external
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.")