Fix subscription module accessing an invalid URL for REST-API #85
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.
The subscription REST-API lives under
/subscription
. However the code tried accessing/undefined/subscriptionundefined
.The reason is that the base URL is supposed to be encoded in the HTML attribute
data-base-url
and the path indata-path
. These attribute names can not be used in Python as argument because they contain dashes. So in Python the dashes are replaced by underscores.genshi.builder.tag
converts the underscores back to dashes and therefore generates the required attribute names. Its supposed replacementtrac.util.html.html
(which was enabled in fa7cdff) does not perform such a conversion thereby generating the wrong HTML attributes leading to the wrong URL in the request.For the upcoming migration away from Genshi we could consider using the already present
CodeComments
dictionary. It already contains a "path" element, although with a somewhat different content.