awx
awx copied to clipboard
Make named url work with optional url prefix
SUMMARY
- Make named url work with optional url prefix
ISSUE TYPE
- Bug, Docs Fix or other nominal change
COMPONENT NAME
- API
AWX VERSION
devel
ADDITIONAL INFORMATION
This is really hard to parse. My reading is that the job of this method is to extract the named component of the URL, and then call the method that gets the pk from that, and glue it back together and return that. I would like the high-level conditional to be more clear. Like, after stripping the leading/trailing slashes, .startswith("api/v2")
seems like it would be a really durable and understandable heuristic. The stuff with counting the number of slashes starts looking like insanity.