Merge lp:~cody-somerville/launchpad/bug-444266 into lp:launchpad
Proposed by
Cody A.W. Somerville
on 2010-04-27
| Status: | Merged |
|---|---|
| Approved by: | Gavin Panella on 2010-04-28 |
| Approved revision: | no longer in the source branch. |
| Merged at revision: | 10835 |
| Proposed branch: | lp:~cody-somerville/launchpad/bug-444266 |
| Merge into: | lp: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:~cody-somerville/launchpad/bug-444266 |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Gavin Panella (community) | 2010-04-27 | Approve on 2010-04-28 | |
|
Review via email:
|
|||
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...