~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/code/browser/sourcepackagerecipe.py

  • Committer: Brad Crittenden
  • Date: 2011-08-30 20:12:34 UTC
  • mto: This revision was merged to the branch mainline in revision 13830.
  • Revision ID: bac@canonical.com-20110830201234-rpllzg567mzsseah
Catch TooManyBuild exception rather than OOPS

Show diffs side-by-side

added added

removed removed

Lines of Context:
99
99
    BuildAlreadyPending,
100
100
    NoSuchBranch,
101
101
    PrivateBranchRecipe,
 
102
    TooManyBuilds,
102
103
    TooNewRecipeFormat,
103
104
    )
104
105
from lp.code.interfaces.branchtarget import IBranchTarget
135
136
 
136
137
 
137
138
class SourcePackageRecipeHierarchy(Hierarchy):
138
 
    """"Hierarchy for Source Package Recipe."""
 
139
    """Hierarchy for Source Package Recipe."""
139
140
 
140
141
    vhost_breadcrumb = False
141
142
 
541
542
    @action('Build now', name='build')
542
543
    def build_action(self, action, data):
543
544
        recipe = self.context
544
 
        builds = recipe.performDailyBuild()
 
545
        try:
 
546
            builds = recipe.performDailyBuild()
 
547
        except TooManyBuilds, e:
 
548
            self.request.response.addErrorNotification(str(e))
 
549
            self.next_url = canonical_url(recipe)
 
550
            return
 
551
 
545
552
        if self.request.is_ajax:
546
553
            template = ViewPageTemplateFile(
547
554
                    "../templates/sourcepackagerecipe-builds.pt")