fix matching of descendants during delete
This commit is contained in:
parent
54cdfa4685
commit
19deeb9512
1 changed files with 2 additions and 1 deletions
|
|
@ -460,11 +460,12 @@ def remove_all(
|
||||||
if hostname is None:
|
if hostname is None:
|
||||||
hostname = config.hostname
|
hostname = config.hostname
|
||||||
|
|
||||||
|
location_dir = location if location.endswith("/") else location + "/"
|
||||||
selector = and_(
|
selector = and_(
|
||||||
metadex.c.hostname == hostname,
|
metadex.c.hostname == hostname,
|
||||||
or_(
|
or_(
|
||||||
metadex.c.location == location,
|
metadex.c.location == location,
|
||||||
metadex.c.location.startswith(location + "/", autoescape=True),
|
metadex.c.location.startswith(location_dir, autoescape=True),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
stmt = select(metadex.c.location).where(selector)
|
stmt = select(metadex.c.location).where(selector)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue