From: Michael Tremer Date: Tue, 13 Jan 2026 11:48:27 +0000 (+0000) Subject: domains: Don't list domains from deleted lists X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=77dad4de6c6562513ab9d781dfd7809cf7bba064;p=dbl.git domains: Don't list domains from deleted lists Signed-off-by: Michael Tremer --- diff --git a/src/dbl/domains.py b/src/dbl/domains.py index 3f29ca2..be70add 100644 --- a/src/dbl/domains.py +++ b/src/dbl/domains.py @@ -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, ) )