~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/bugs/browser/bugtask.py

[r=sinzui][bug=904902] When a bugtask is deleted,
 also delete any associated BugNomination record so that the bug can
 then be re-nominated against the target again.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1790
1790
    def next_url(self):
1791
1791
        """Return the next URL to call when this call completes."""
1792
1792
        if not self.request.is_ajax:
1793
 
            return super(BugTaskDeletionView, self).next_url
 
1793
            return self._next_url or self._return_url
1794
1794
        return None
1795
1795
 
1796
1796
    @action('Delete', name='delete_bugtask')
1801
1801
        success_message = ("This bug no longer affects %s."
1802
1802
                    % bugtask.bugtargetdisplayname)
1803
1803
        error_message = None
 
1804
        # We set the next_url here before the bugtask is deleted since later
 
1805
        # the bugtask will not be available if required to construct the url.
 
1806
        self._next_url = self._return_url
1804
1807
 
1805
1808
        try:
1806
1809
            bugtask.delete()