Repository: ietf-tools/datatracker

Issue:
Broken URLs in BIAS Workshop meeting material
### Describe the issue

At https://datatracker.ietf.org/meeting/interim-2024-biasws-01/session/biasws when you click on Paper: Community Networks and the Quest for Quality which links to https://www.ietf.org/slides/slides-biasws-community-networks-and-the-quest-for-quality-00, you get a 404! 

Same happens for "Paper: A ‘C’ in CDN: Access service to and from the Internet at cost for community networks" links to https://www.ietf.org/slides/slides-biasws-a-c-in-cdn-access-service-to-and-from-the-internet-at-cost-for-community-networks-00 and you get a 404! 

Other links that are broken --

https://www.ietf.org/slides/slides-biasws-closing-the-performance-and-management-gaps-with-satellite-internet-challenges-approaches-and-future-directions-01
https://www.ietf.org/slides/slides-biasws-position-paper-by-raquel-renno-01

While the rest seems to work fine! 

### Code of Conduct

- [X] I agree to follow the [IETF's Code of Conduct](https://github.com/ietf-tools/.github/blob/main/CODE_OF_CONDUCT.md)


Discussion:
There appears to be something wrong with the state settings on the `Document` for the slides with broken links. Looking to see why.

(the `meeting_related()` test is returning `False`, which I _think_ is why it's getting a broken URL, but still poking)

Edit: perhaps related to the problem, but fixing will take more than just marking the docs as meeting related - doing so leads to a different bad URL.
Ah - just need to add a `.pdf` to the end of the bad URL to get a live one. Looking to see what's going wrong.
This and #7017 both are rooted in there being confusion about group materials documents (that is, those that show on the group's materials page) and session material documents (those intended to be managed at the session materials page.

The first have names that start as `slides-biaswg-`

the second have names that start as `slides-interim-2024-biaswg-`

Some of the first ended up attached to sessions and people tried to upload new revisions from the session view instead of the groups material view.

Untangling this will be difficult, and will take several people, so it will likely not be until tomorrow when Cindy and the tools-team can work on this together. I've improved the problem for `slides-biasws-imap-internet-monitoring-action-project-internet-censorship-report`
representing the status of JSON Web Tokens (JWTs) [RFC7519] and CBOR
>     Web Tokens (CWTs) [RFC8392].  The status list data structures
>     themselves are also represented as JWTs or CWTs

Resolving patch:
diff --git a/ietf/doc/models.py b/ietf/doc/models.py
--- a/ietf/doc/models.py
+++ b/ietf/doc/models.py
@@ -280,6 +280,19 @@ def _get_ref(self, meeting=None, meeting_doc_refs=settings.MEETING_DOC_HREFS):
                 info = dict(doc=self)
 
             href = format.format(**info)
+
+            # For slides that are not meeting-related, we need to know the file extension.
+            # Assume we have access to the same files as settings.DOC_HREFS["slides"] and
+            # see what extension is available
+            if  self.type_id == "slides" and not self.meeting_related() and not href.endswith("/"):
+                filepath = Path(self.get_file_path()) / self.get_base_name()  # start with this
+                if not filepath.exists():
+                    # Look for other extensions - grab the first one, sorted for stability
+                    for existing in sorted(filepath.parent.glob(f"{filepath.stem}.*")):
+                        filepath = filepath.with_suffix(existing.suffix)
+                        break
+                href += filepath.suffix  # tack on the extension
+
             if href.startswith('/'):
                 href = settings.IDTRACKER_BASE_URL + href
             self._cached_href = href


Test patch: