]> git.ipfire.org Git - dbl.git/commitdiff
sources: Always return an integer for the length of the source
authorMichael Tremer <michael.tremer@ipfire.org>
Sat, 3 Jan 2026 13:31:28 +0000 (13:31 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 3 Jan 2026 13:31:28 +0000 (13:31 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/dnsbl/sources.py

index 8258924d8c8b81056d2ebe06d10ee47c64eb945b..01868ace740fd9f909a4aa24f01d490fe05d6fdd 100644 (file)
@@ -104,7 +104,7 @@ class Source(sqlmodel.SQLModel, database.BackendMixin, table=True):
                return self.name
 
        def __len__(self):
-               return self.total_domains
+               return self.total_domains or 0
 
        def __hash__(self):
                # Only hashable once the object has an ID