Merge lp:~jcsackett/launchpad/api-pillar-redirects-715992 into lp:launchpad
Status: | Merged |
---|---|
Approved by: | Robert Collins |
Approved revision: | no longer in the source branch. |
Merged at revision: | 12364 |
Proposed branch: | lp:~jcsackett/launchpad/api-pillar-redirects-715992 |
Merge into: | lp:launchpad |
Diff against target: |
89 lines (+35/-7) 3 files modified
lib/canonical/launchpad/browser/launchpad.py (+2/-1) lib/canonical/launchpad/webapp/publisher.py (+5/-6) lib/lp/registry/tests/test_product_webservice.py (+28/-0) |
To merge this branch: | bzr merge lp:~jcsackett/launchpad/api-pillar-redirects-715992 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Robert Collins (community) | Approve | ||
Review via email: mp+49279@code.launchpad.net |
Commit message
[r=lifeless][bug=715992] Corrects use of canonical_url so that requests for pillars via alias on the API do not redirect outside of the API layer.
Description of the change
Summary
=======
Pillars can have aliases, which are linked back to their actual names/pages through use of canonical_url. This use of canonical_url, when dealing with webservice requests, accidentally redirects the request outside of the api layer. This branch deals with that by making sure the use of canonical_url is aware of the current request, so it doesn't have to guess at it.
Preimplementation
=================
Spoke with Leonard Richardson.
Followed up with Robert Collins on some confusing code in canonical_url.
Proposed Fix
============
Per Leonard Richardson, find the method that forgets the current request, and make sure request is passed in.
Implementation
==============
lib/canonical/
-------
The use of canonical_url to find the url of the pillar with the supplied alias now has the request passed into it.
lib/canonical/
-------
Comment changes on canonical_url to make it clearer what's going on with the request parameter.
lib/lp/
-------
Created tests.
Tests
=====
bin/test -t test_product_
Demo & QA
=========
Open http://
Lint
====
make lint output:
= Launchpad lint =
Checking for conflicts and issues in changed files.
Linting changed files:
lib/canonical
lib/canonical
lib/lp/