Merge lp://staging/~cody-somerville/launchpad/bug-444266 into lp://staging/launchpad
Proposed by
Cody A.W. Somerville
Status: | Merged |
---|---|
Approved by: | Gavin Panella |
Approved revision: | no longer in the source branch. |
Merged at revision: | 10835 |
Proposed branch: | lp://staging/~cody-somerville/launchpad/bug-444266 |
Merge into: | lp://staging/launchpad |
Diff against target: |
313 lines (+141/-19) 8 files modified
lib/canonical/launchpad/interfaces/launchpad.py (+3/-2) lib/lp/bugs/browser/bugsupervisor.py (+20/-3) lib/lp/bugs/interfaces/bugsupervisor.py (+20/-9) lib/lp/bugs/stories/webservice/xx-bug-target.txt (+83/-0) lib/lp/registry/interfaces/distribution.py (+4/-2) lib/lp/registry/interfaces/product.py (+5/-3) lib/lp/registry/stories/webservice/xx-distribution.txt (+2/-0) lib/lp/registry/stories/webservice/xx-project-registry.txt (+4/-0) |
To merge this branch: | bzr merge lp://staging/~cody-somerville/launchpad/bug-444266 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Gavin Panella (community) | Approve | ||
Review via email: mp+24273@code.staging.launchpad.net |
Commit message
Expose bug supervisor and security contact via webservices API for projects and distributions.
Description of the change
Export bug_supervisor and security_contact to implement LP #444266
To post a comment you must log in.
Hi Cody,
Thanks for doing this! This is a nice branch. I have a few small
comments, that's all. Approved, but please address those issues before
landing it.
Gavin.
> === modified file 'lib/canonical/ launchpad/ interfaces/ launchpad. py' launchpad/ interfaces/ launchpad. py 2010-04-19 14:47:49 +0000 launchpad/ interfaces/ launchpad. py 2010-04-28 16:42:08 +0000 declarations import exported interfaces import IServiceRootRes ource launchpad. fields import PublicPersonChoice tact(Interface) : PublicPersonCho ice( 'ValidPersonOrT eam') 'ValidPersonOrT eam')) Interface) : bugs/browser/ bugsupervisor. py' bugs/browser/ bugsupervisor. py 2009-11-12 15:33:27 +0000 bugs/browser/ bugsupervisor. py 2010-04-28 16:42:08 +0000 EditView' ] interfaces. bugsupervisor import IHasBugSupervisor launchpad. webapp import ( rmView) launchpad. webapp. menu import structured interface import copy_field, use_template interfaces. bugsupervisor import IHasBugSupervisor
> --- lib/canonical/
> +++ lib/canonical/
> @@ -14,6 +14,7 @@
> from zope.schema import Bool, Choice, Int, TextLine
> from persistent import IPersistent
>
> +from lazr.restful.
> from lazr.restful.
> from canonical.launchpad import _
> from canonical.
> @@ -439,11 +440,11 @@
> class IHasSecurityCon
> """An object that has a security contact."""
>
> - security_contact = PublicPersonChoice(
> + security_contact = exported(
> title=_("Security Contact"),
> description=_(
> "The person or team who handles security-related bug reports"),
> - required=False, vocabulary=
> + required=False, vocabulary=
>
>
> class IHasIcon(
>
> === modified file 'lib/lp/
> --- lib/lp/
> +++ lib/lp/
> @@ -7,17 +7,30 @@
>
> __all__ = ['BugSupervisor
>
> -
> -from lp.bugs.
> from canonical.
> action, canonical_url, LaunchpadEditFo
> from canonical.
> -
> +from lazr.restful.
> +from zope.interface import Interface
> +
> +from lp.bugs.
> +
2 blank lines between classes.
> +class BugSupervisorEd itSchema( Interface) : IHasBugSupervis or, include=[
> + """Defines the fields for the edit form.
> +
> + This is necessary to make an editable field for bug supervisor as it is
> + defined as read-only in the interface to prevent setting it directly.
> + """
> + use_template(
> + 'bug_supervisor',
> + ])
I don't think you need this use_template() call; its effects are
immediately overwritten below.
> + bug_supervisor = copy_field( or['bug_ supervisor' ], readonly=False)
> + IHasBugSupervis
>
Again, 2 blank lines.
> class BugSupervisorEd itView( LaunchpadEditFo rmView) : itSchema iew`""" ditSchema: self.context}
> """Browser view class for editing the bug supervisor."""
>
> - schema = IHasBugSupervisor
> + schema = BugSupervisorEd
> field_names = ['bug_supervisor']
>
> @property
> @@ -30,6 +43,11 @@
> """The page title."""
> return self.label
>
> + @property
> + def adapters(self):
> + """See `LaunchpadFormV
> + return {BugSupervisorE
Interesting, I've never seen this before.
> +
> @action('Change', name='change')
> def change_action(self, action, data):
> """Redirect to the target page with a success message...