]> git.ipfire.org Git - dbl.git/commitdiff
domains: Don't list domains from deleted lists
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 13 Jan 2026 11:48:27 +0000 (11:48 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 13 Jan 2026 11:48:27 +0000 (11:48 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/dbl/domains.py

index 3f29ca2d9d29e895ea57649ad78274ac532e8513..be70add9bacb7688b6c3430f9ce7d819a22872c8 100644 (file)
@@ -25,6 +25,7 @@ import sqlmodel
 import uuid
 
 from . import database
+from . import lists
 
 # Setup logging
 log = logging.getLogger(__name__)
@@ -42,12 +43,19 @@ class Domains(object):
                        .select(
                                Domain,
                        )
+                       .join(
+                               lists.List,
+                               lists.List.id == Domain.list_id,
+                       )
                        .where(
                                # Name must match
                                Domain.name == name,
 
                                # Ignore domains that have been removed
                                Domain.removed_at == None,
+
+                               # Ignore any lists that have been deleted
+                               lists.List.deleted_at == None,
                        )
                )