diff options
author | B. Stack <bgstack15@gmail.com> | 2023-08-30 18:45:39 -0400 |
---|---|---|
committer | B. Stack <bgstack15@gmail.com> | 2023-08-30 18:45:39 -0400 |
commit | 361e4295a86fb24e5c7961d9621819e9a43b3bb8 (patch) | |
tree | f841108230afa2b8c0edf169e0d23ccfab5a996f | |
parent | ignore dns.resolver.NoAnswer (diff) | |
download | newspipe-361e4295a86fb24e5c7961d9621819e9a43b3bb8.tar.gz newspipe-361e4295a86fb24e5c7961d9621819e9a43b3bb8.tar.bz2 newspipe-361e4295a86fb24e5c7961d9621819e9a43b3bb8.zip |
improve syntax
-rw-r--r-- | newspipe/bootstrap.py | 1 | ||||
-rw-r--r-- | newspipe/controllers/user.py | 4 |
2 files changed, 1 insertions, 4 deletions
diff --git a/newspipe/bootstrap.py b/newspipe/bootstrap.py index ac8147c7..9160c857 100644 --- a/newspipe/bootstrap.py +++ b/newspipe/bootstrap.py @@ -53,7 +53,6 @@ class ReverseProxied(object): environ['SCRIPT_NAME'] = self.script_name return self.app(environ, start_response) - # Create Flask application application = Flask(__name__, instance_relative_config=True) configuration = os.environ.get("NEWSPIPE_CONFIG", False) diff --git a/newspipe/controllers/user.py b/newspipe/controllers/user.py index 77bcc9be..c073ee5f 100644 --- a/newspipe/controllers/user.py +++ b/newspipe/controllers/user.py @@ -125,11 +125,9 @@ class LdapuserController(object): namelist = [] try: query = dns.resolver.query(f"_ldap._tcp.{domain}","SRV") - except dns.resolver.NXDOMAIN: + except (dns.resolver.NXDOMAIN, dns.resolver.NoAnswer): # no records exist that match the request, so we were probably given a specific hostname, and an empty query will trigger the logic below that will add the original domain to the list. query = [] - except dns.resolver.NoAnswer: - query = [] for i in query: namelist.append(i.target.to_text().rstrip(".")) if not len(namelist): |