awx icon indicating copy to clipboard operation
awx copied to clipboard

Make named url work with optional url prefix

Open chrismeyersfsu opened this issue 10 months ago • 1 comments

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

chrismeyersfsu avatar Apr 16 '24 20:04 chrismeyersfsu

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.

AlanCoding avatar Apr 22 '24 17:04 AlanCoding