~launchpad-pqm/launchpad/devel

« back to all changes in this revision

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

  • Committer: Graham Binns
  • Date: 2011-09-07 15:59:13 UTC
  • mto: This revision was merged to the branch mainline in revision 13914.
  • Revision ID: graham@canonical.com-20110907155913-p97tx2e34ysbcgp3
Added an XXX.

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
 
479
480
    def _process_error(self, data=None, builds=None, informational=None,
480
481
                       errors=None, reason="Validation"):
481
482
        """Set up the response and json data to return to the caller."""
482
 
        self.request.response.setStatus(400, reason)
 
483
        self.request.response.setStatus(200, reason)
483
484
        self.request.response.setHeader('Content-type', 'application/json')
484
485
        return_data = dict(builds=builds, errors=errors)
485
486
        if informational:
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")