datatracker
datatracker copied to clipboard
fix: Handle RFC names that are not all lowercase or have spaces
Fixes #4576
Codecov Report
Merging #4650 (06de127) into main (69c0f4d) will decrease coverage by
0.00%. The diff coverage is100.00%.
@@ Coverage Diff @@
## main #4650 +/- ##
==========================================
- Coverage 88.41% 88.40% -0.01%
==========================================
Files 296 296
Lines 39730 39730
==========================================
- Hits 35126 35124 -2
- Misses 4604 4606 +2
| Impacted Files | Coverage Δ | |
|---|---|---|
| ietf/doc/utils.py | 88.58% <100.00%> (ø) |
|
| ietf/nomcom/utils.py | 91.50% <100.00%> (ø) |
|
| ietf/group/utils.py | 93.72% <0.00%> (-0.90%) |
:arrow_down: |
| ietf/submit/forms.py | 82.70% <0.00%> (ø) |
|
| ietf/doc/views_search.py | 89.23% <0.00%> (ø) |
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.
Fixes https://github.com/ietf-tools/datatracker/issues/4576
This is a surprising fix for that bug. I think it is probably just avoiding a bug we have elsewhere in the code that should be addressed. Did you determine why this ended up on the last draft instead of the RFC? I would have expected there to be code that would be touching that decision directly.
The issue is that the if re.match("^[Rr][Ff][Cc] [0-9]+$",name): case in the original code doesn't hit, because of the space in the pattern. And even if it did, it would rewrite name incorrectly, because the replacement assumes a space exists. So the name never gets lowercased, and that seems to mess with the database query.