diff --git a/tools/place_trails.py b/tools/place_trails.py index db8b93a..402aeeb 100644 --- a/tools/place_trails.py +++ b/tools/place_trails.py @@ -958,10 +958,11 @@ def apply(proposal_path, root, today, exclude=frozenset()): names = {(v["kind"], v["slug"]): v["name"] for v in per_place.values()} written = [] named = set() + trackless = set(data.get("no_track") or []) for tid in sorted(data.get("per_trail") or {}): tdir = os.path.join(root, tid) - if not os.path.isfile(os.path.join(tdir, "trail.toml")): - continue + if tid in trackless or not os.path.isfile(os.path.join(tdir, "trail.toml")): + continue # a trail with no track is placed by a person (stated, stamp) doc, path = _doc_of(root, tid) rec = doc.data() new_places = [p for p in data["per_trail"][tid] diff --git a/tools/tests/test_place_trails.py b/tools/tests/test_place_trails.py index cbeaca5..06b7a47 100644 --- a/tools/tests/test_place_trails.py +++ b/tools/tests/test_place_trails.py @@ -421,6 +421,12 @@ class ApplyTest(unittest.TestCase): if line.strip(): self.assertIn(line, after.splitlines(), line) + def test_apply_leaves_a_trail_with_no_track_alone_for_a_person_to_place(self): + before = open(self.trail_toml("zz"), "rb").read() + written = P.apply(self.pjson, self.root, "2026-11-20") + self.assertNotIn("zz", written) + self.assertEqual(open(self.trail_toml("zz"), "rb").read(), before) + def test_apply_adds_one_history_entry_naming_place_with_no_distance_in_it(self): P.apply(self.pjson, self.root, "2026-11-20") data = read_toml(self.trail_toml("aa"))