~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/app/browser/launchpad.py

  • Committer: Launchpad Patch Queue Manager
  • Date: 2011-06-28 09:47:36 UTC
  • mfrom: (13303.4.1 squiggle-me)
  • Revision ID: launchpad@pqm.canonical.com-20110628094736-ft99kat9mgzzt2kc
[r=sinzui][bug=785800] https://launchpad.net/~ now redirects you to
        your home page

Show diffs side-by-side

added added

removed removed

Lines of Context:
647
647
        if name in self.stepto_utilities:
648
648
            return getUtility(self.stepto_utilities[name])
649
649
 
650
 
        # Allow traversal to ~foo for People
651
 
        if name.startswith('~'):
652
 
            # account for common typing mistakes
 
650
        if name == '~':
 
651
            person = getUtility(ILaunchBag).user
 
652
            if person is None:
 
653
                raise Unauthorized()
 
654
            # Keep the context and the subtree so that
 
655
            # bugs.l.n/~/+assignedbugs goes to the person's canonical
 
656
            # assigned list.
 
657
            return self.redirectSubTree(
 
658
                canonical_url(self.context) + "~"
 
659
                + canonical_name(person.name),
 
660
                status=302)
 
661
        elif name.startswith('~'):  # Allow traversal to ~foo for People
653
662
            if canonical_name(name) != name:
 
663
                # (for instance, uppercase username?)
654
664
                if self.request.method == 'POST':
655
665
                    raise POSTToNonCanonicalURL
656
666
                return self.redirectSubTree(