]> git.ipfire.org Git - dbl.git/commitdiff
lists: Perform whitelist check only if anything is actually whitelisted
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 27 Feb 2026 11:22:29 +0000 (11:22 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 27 Feb 2026 11:22:29 +0000 (11:22 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/dbl/lists.py

index 70e03a6d86e121fa1834899cb3bd8fcf8ea4b09e..df7e1398a7748e346f6469c3ec2e79c6518928bc 100644 (file)
@@ -827,11 +827,12 @@ class List(sqlmodel.SQLModel, database.BackendMixin, table=True):
                redundant_names = set()
 
                # List everything that isn't whitelisted
-               for name in names:
-                       if util.is_name_in(name, whitelisted):
-                               delisted_names.add(name)
+               if whitelisted:
+                       for name in names:
+                               if util.is_name_in(name, whitelisted):
+                                       delisted_names.add(name)
 
-               # Walk through all domains
+               # Find any redundant domains
                for name in names:
                        if util.is_parent_in(name, names):
                                        redundant_names.add(name)