~launchpad-pqm/launchpad/devel

« back to all changes in this revision

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

  • Committer: William Grant
  • Date: 2011-05-20 08:23:45 UTC
  • mfrom: (13067.3.7 bug-783855-1)
  • mto: This revision was merged to the branch mainline in revision 13117.
  • Revision ID: william.grant@canonical.com-20110520082345-kwkdutly0ovlvto9
Merge bug-783855-1.

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
from datetime import datetime
27
27
from operator import itemgetter
28
28
import urllib
 
29
from urlparse import urljoin
29
30
 
30
31
from lazr.restful.interface import copy_field
31
32
from pytz import timezone
96
97
    GhostWidget,
97
98
    ProductBugTrackerWidget,
98
99
    )
 
100
from lp.bugs.publisher import BugsLayer
99
101
from lp.bugs.browser.bugrole import BugRoleMixin
100
102
from lp.bugs.browser.bugtask import BugTaskSearchListingView
101
103
from lp.bugs.browser.structuralsubscription import (
1065
1067
                config.malone.ubuntu_bug_filing_url)
1066
1068
 
1067
1069
    @safe_action
1068
 
    @action("Continue", name="projectgroupsearch", validator="validate_search")
 
1070
    @action("Continue", name="projectgroupsearch",
 
1071
            validator="validate_search")
1069
1072
    def projectgroup_search_action(self, action, data):
1070
1073
        """Search for similar bug reports."""
1071
1074
        # Don't give focus to any widget, to ensure that the browser
1568
1571
 
1569
1572
    def initialize(self):
1570
1573
        super(TargetSubscriptionView, self).initialize()
 
1574
        # Some resources such as help files are only provided on the bugs
 
1575
        # rootsite.  So if we got here via another, possibly hand-crafted, URL
 
1576
        # redirect to the equivalent URL on the bugs rootsite.
 
1577
        if not BugsLayer.providedBy(self.request):
 
1578
            new_url = urljoin(
 
1579
                self.request.getRootURL('bugs'), self.request['PATH_INFO'])
 
1580
            self.request.response.redirect(new_url)
 
1581
            return
1571
1582
        expose_structural_subscription_data_to_js(
1572
1583
            self.context, self.request, self.user, self.subscriptions)
1573
1584