~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/blueprints/interfaces/specification.py

Fix lint.

Show diffs side-by-side

added added

removed removed

Lines of Context:
46
46
    )
47
47
 
48
48
from canonical.launchpad import _
49
 
from canonical.launchpad.webapp import canonical_url
50
 
from canonical.launchpad.webapp.menu import structured
51
49
from lp.app.validators import LaunchpadValidationError
52
50
from lp.app.validators.url import valid_webref
53
51
from lp.blueprints.enums import (
124
122
 
125
123
class SpecURLField(TextLine):
126
124
 
127
 
    errormessage = _('%s is already registered by <a href=\"%s\">%s</a>.')
 
125
    errormessage = _("%s is already registered by another blueprint.")
128
126
 
129
127
    def _validate(self, specurl):
130
128
        TextLine._validate(self, specurl)
135
133
 
136
134
        specification = getUtility(ISpecificationSet).getByURL(specurl)
137
135
        if specification is not None:
138
 
            specification_url = canonical_url(specification)
139
 
            raise LaunchpadValidationError(
140
 
                    structured(self.errormessage, specurl, specification_url,
141
 
                        specification.title))
 
136
            raise LaunchpadValidationError(self.errormessage % specurl)
142
137
 
143
138
 
144
139
class ISpecificationPublic(IHasOwner, IHasLinkedBranches):
378
373
        CollectionField(
379
374
            title=_("Branches associated with this spec, usually "
380
375
            "branches on which this spec is being implemented."),
381
 
            value_type=Reference(schema=Interface),  # ISpecificationBranch
 
376
            value_type=Reference(schema=Interface), # ISpecificationBranch
382
377
            readonly=True),
383
378
        as_of="devel")
384
379
 
588
583
 
589
584
    export_as_webservice_entry(as_of="beta")
590
585
 
591
 
    @operation_parameters(
592
 
        bug=Reference(schema=Interface))  # Really IBug
593
 
    @export_write_operation()
594
 
    @operation_for_version('devel')
595
 
    def linkBug(bug):
596
 
        """Link a bug to this specification.
597
 
 
598
 
        :param bug: IBug to link.
599
 
        """
600
 
 
601
 
    @operation_parameters(
602
 
        bug=Reference(schema=Interface))  # Really IBug
603
 
    @export_write_operation()
604
 
    @operation_for_version('devel')
605
 
    def unlinkBug(bug):
606
 
        """Unlink a bug to this specification.
607
 
 
608
 
        :param bug: IBug to unlink.
609
 
        """
610
 
 
611
586
 
612
587
class ISpecificationSet(IHasSpecifications):
613
588
    """A container for specifications."""