thing.delete() tries to refresh

Bug #524778 reported by Robert Collins
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
Low
Unassigned

Bug Description

 affects launchpad
 done

m = launchpad.load('foo/+milestone/bar'
m.delete() # boom - 404 errror

Doesn't make sense to refresh after doing a delete - or at most, should
catch 404 itself and raise *if 404 isn't returned*

-Rob

Related branches

Curtis Hovey (sinzui)
affects: launchpad → launchpadlib
Curtis Hovey (sinzui)
affects: launchpadlib → lazr.restful
Changed in lazr.restful:
importance: Undecided → Low
status: New → Triaged
Revision history for this message
Markus Korn (thekorn) wrote :

For me the issue seem to be that milestone.delete() is exported as a POST method, and not DELETE

Revision history for this message
Stephane Wirtel (OpenERP) (stephane-openerp) wrote :

Hi all,

Please, Could you provide a patch and update the python-launchpadlib package.

Thank you so much

Revision history for this message
Leonard Richardson (leonardr) wrote :

Markus is right. If you publish a method as a write operation, launchpadlib will invoke it with POST and refresh the object afterwards, even if the method happens to be called 'delete'. This method needs to be published as a destructor operation. (@export_destructor_operation instead of @export_write_operation) Then it will be invoked with DELETE and launchpadlib will know better than to refresh it.

This is entirely a problem with Launchpad. Once it's fixed, existing installations of launchpadlib will start working automatically.

affects: lazr.restful → launchpad-foundations
tags: added: api
Revision history for this message
Gary Poster (gary) wrote :

Curtis, if you are willing to triage this as high, that would be great. However, if you triage this as low, I'll push the task up to high in Foundations and try to make the change this cycle.

Curtis Hovey (sinzui)
Changed in launchpad-registry:
status: New → Triaged
importance: Undecided → High
milestone: none → 10.04
Revision history for this message
Robert Collins (lifeless) wrote : Re: [Bug 524778] Re: milestone.delete() tries to refresh

On Wed, 2010-04-07 at 12:09 +0000, Stephane (Open ERP) wrote:
> Hi all,
>
> Please, Could you provide a patch and update the python-launchpadlib
> package.

the package doesn't need to change - see the discussion.

-Rob

Brad Crittenden (bac)
Changed in launchpad-registry:
assignee: nobody → Brad Crittenden (bac)
Brad Crittenden (bac)
Changed in launchpad-registry:
status: Triaged → In Progress
Revision history for this message
Brad Crittenden (bac) wrote : Re: milestone.delete() tries to refresh

The @export_destructor_operation approach does not work at this time. Using it causes the method to be uncallable. Leaving the method exported as a 'write' is the best work-around, even though it does throw the subsequent NotFound error.

It is the best that can be done until bug 534363 is fixed.

Changed in launchpad-registry:
status: In Progress → Triaged
Revision history for this message
Brad Crittenden (bac) wrote :

Actually, the answer given to question 102714 (linked) shows the work-around for calling the destructor. The delete method for milestones can be converted to a destructor but the call sites will have to use the work-around for now.

Changed in launchpad-registry:
status: Triaged → In Progress
Curtis Hovey (sinzui)
Changed in launchpad-registry:
assignee: Brad Crittenden (bac) → nobody
status: In Progress → Triaged
milestone: 10.04 → series-10.05
Curtis Hovey (sinzui)
Changed in launchpad-registry:
milestone: series-10.05 → 10.04
assignee: nobody → Brad Crittenden (bac)
Curtis Hovey (sinzui)
Changed in launchpad-registry:
status: Triaged → In Progress
Revision history for this message
Ursula Junque (ursinha) wrote : Bug fixed by a commit
Changed in launchpad-registry:
status: In Progress → Fix Committed
tags: added: qa-needstesting
Brad Crittenden (bac)
tags: added: qa-ok
removed: qa-needstesting
Revision history for this message
Curtis Hovey (sinzui) wrote : Bug 524778 Fix released

Fixed released in launchpad-project 10.04.

Changed in launchpad-registry:
status: Fix Committed → Fix Released
William Grant (wgrant)
tags: removed: qa-ok
Curtis Hovey (sinzui)
summary: - milestone.delete() tries to refresh
+ thing.delete() tries to refresh
Curtis Hovey (sinzui)
Changed in launchpad:
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related questions

Remote bug watches

Bug watches keep track of this bug in other bug trackers.