Repository navigation
Allow hyphens in location names in the legacy room export API - #7806
Thanatos9404 wants to merge 3 commits into
Conversation
|
Looks like in this particular place we don't allow providing multiple values (which are typically dash-separated as well), so allowing dashes there may actually be possible! |
|
Did you actually test it btw? Ie both running the test and trying it out on an actual Indico server (ideally your own local dev setup where you have your patch applied)? |
|
Yes. The new test passes on the branch (its two hyphenated cases fail against master), and the whole |
|
Are you using an LLM to write these comments? 🙈 They read a bit like something an LLM would write... |
|
Yes, I used an AI assistant to understand the codebase and to help write the fix and these comments. The tests and the check on a local Indico instance described above were actually run. |
Fixes #6527
The
roomandroomNameexport endpoints only accepted letters, digits, underscores and whitespace in the location part of the URL, so a location such as "HIM-Building 1395" never matched and the request failed. As ThiefMaster suggested in the issue, the location group of both hooks now uses[\w\s-]+. Slashes and dots are still excluded, so the location remains a single path segment. Thereservationendpoint is left alone because it uses-to separate multiple locations, so a hyphenated name still cannot be passed there. I added a parametrized test for request path parsing that fails on master for the two hyphenated cases and passes with this change, and ruff and isort are clean.