-
Notifications
You must be signed in to change notification settings - Fork 757
fix: Use the doc name matched by fuzzy_find_documents when rendering #4862
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
a36f7d6
fix: Use the doc name matched by fuzzy_find_documents when rendering
larseggert ac87d98
Merge remote-tracking branch 'origin/main' into fix-4855
larseggert 7574741
Follow suggestion by @rjsparks
larseggert c9a1477
Merge branch 'main' into fix-4855
larseggert 4efa1d9
Merge branch 'main' into fix-4855
larseggert File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -810,7 +810,8 @@ def document_html(request, name, rev=None): | |
| raise Http404("Multiple documents matched: %s" % name) | ||
|
|
||
| if found.matched_name.startswith('rfc') and name != found.matched_name: | ||
| return redirect('ietf.doc.views_doc.document_html', name=found.matched_name) | ||
| name = found.matched_name | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This does nothing - name is never used after this assignment. |
||
| return redirect('ietf.doc.views_doc.document_html', name=found.matched_name) | ||
|
|
||
| doc = found.documents.get() | ||
|
|
||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem you are working on is dealing with URLs like
https://datatracker.ietf.org/doc/html/draft-ietf-oauth-v2-1-07. And the issue is that the URL dispatcher is handingTo the view.
What's in the PR right now won't help since (beyond it being a no-op) the change is in the logic branch gated on finding something that starts with 'rfc'.
Your original commit was closer, and the property I was hoping to get out of the redirect isn't going to happen since the globbing is getting things so wrong to begin with.
I'll take the PR back to that commit, but we need to add tests to make sure that this isn't just pushing the general problem around and breaking other things.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Our real problem is that we have
in URL_REGEXPS so that we can match charter document versions that look like -00-01, which was a terrible thing to have let happen, and maybe we should refactor the URL parsers to match charters first with that rev pattern and everything else with just
[0-9]{2}.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For instance, this is 404ing, and it shouldn't:
https://datatracker.ietf.org/doc/html/draft-ietf-tsvwg-ieee-802-11
It should be showing RFC8325.
Your earlier fix causes it to show draft-ietf-tsvwg-ieee-802-11-11, so there's more to fix than just this name change.