diff --git a/ietf/doc/templatetags/ietf_filters.py b/ietf/doc/templatetags/ietf_filters.py index 4c200a4700..35c79ac28d 100644 --- a/ietf/doc/templatetags/ietf_filters.py +++ b/ietf/doc/templatetags/ietf_filters.py @@ -906,13 +906,17 @@ def mtime(path): """Returns a datetime object representing mtime given a pathlib Path object""" return datetime.datetime.fromtimestamp(path.stat().st_mtime).astimezone(ZoneInfo(settings.TIME_ZONE)) +@register.filter +def mtime_is_epoch(path): + return path.stat().st_mtime == 0 + @register.filter def url_for_path(path): """Consructs a 'best' URL for web access to the given pathlib Path object. Assumes that the path is into the Internet-Draft archive or the proceedings. """ - if path.match(f"{settings.AGENDA_PATH}/**/*"): + if Path(settings.AGENDA_PATH) in path.parents: return ( f"https://www.ietf.org/proceedings/{path.relative_to(settings.AGENDA_PATH)}" ) diff --git a/ietf/doc/utils.py b/ietf/doc/utils.py index 8ec3985b8b..ddf6e015e0 100644 --- a/ietf/doc/utils.py +++ b/ietf/doc/utils.py @@ -1388,14 +1388,18 @@ def investigate_fragment(name_fragment): can_verify = set() for root in [settings.INTERNET_DRAFT_PATH, settings.INTERNET_DRAFT_ARCHIVE_DIR]: can_verify.update(list(Path(root).glob(f"*{name_fragment}*"))) - + archive_verifiable_names = set([p.name for p in can_verify]) + # Can also verify drafts in proceedings directories can_verify.update(list(Path(settings.AGENDA_PATH).glob(f"**/*{name_fragment}*"))) # N.B. This reflects the assumption that the internet draft archive dir is in the # a directory with other collections (at /a/ietfdata/draft/collections as this is written) - unverifiable_collections = set( + unverifiable_collections = set([ + p for p in Path(settings.INTERNET_DRAFT_ARCHIVE_DIR).parent.glob(f"**/*{name_fragment}*") - ) + if p.name not in archive_verifiable_names + ]) + unverifiable_collections.difference_update(can_verify) expected_names = set([p.name for p in can_verify.union(unverifiable_collections)]) diff --git a/ietf/templates/doc/investigate.html b/ietf/templates/doc/investigate.html index 80b004c838..bdcf644406 100644 --- a/ietf/templates/doc/investigate.html +++ b/ietf/templates/doc/investigate.html @@ -23,12 +23,24 @@