Merge lp:~edwin-grubbs/launchpad/bug-615654-queue-addmember-emails into lp:launchpad/db-devel
| Status: | Merged |
|---|---|
| Approved by: | Edwin Grubbs on 2010-09-20 |
| Approved revision: | no longer in the source branch. |
| Merged at revision: | 9873 |
| Proposed branch: | lp:~edwin-grubbs/launchpad/bug-615654-queue-addmember-emails |
| Merge into: | lp:launchpad/db-devel |
| Prerequisite: | lp:~edwin-grubbs/launchpad/bug-615654-registry-jobqueue-schema |
| Diff against target: |
875 lines (+551/-99) 8 files modified
lib/lp/registry/configure.zcml (+17/-0) lib/lp/registry/doc/teammembership-email-notification.txt (+25/-11) lib/lp/registry/enum.py (+12/-0) lib/lp/registry/interfaces/persontransferjob.py (+70/-0) lib/lp/registry/model/persontransferjob.py (+334/-0) lib/lp/registry/model/teammembership.py (+7/-88) lib/lp/registry/tests/test_persontransferjob.py (+62/-0) lib/lp/testing/mail_helpers.py (+24/-0) |
| To merge this branch: | bzr merge lp:~edwin-grubbs/launchpad/bug-615654-queue-addmember-emails |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Brad Crittenden (community) | code | 2010-09-17 | Approve on 2010-09-17 |
|
Review via email:
|
|||
Description of the Change
Summary
-------
This branch adds the MembershipNotif
after the team membership status has changed, e.g. proposed, approved,
admin, expired.
A follow-up branch will be needed in order to add a cronjob to actually
process the job queue. This branch can't land until then.
Implementation details
-------
lib/lp/
lib/
lib/
lib/
lib/
Tests:
lib/
lib/
lib/
Tests
-----
./bin/test -vv -t 'teammembership
| Edwin Grubbs (edwin-grubbs) wrote : | # |
On Fri, Sep 17, 2010 at 3:12 PM, Brad Crittenden <email address hidden> wrote:
> Review: Approve code
> Hi Edwin,
>
> Very interesting branch. I've got some suggestions but overall it is great.
>
> --Brad
Thanks for the review.
>> === added file 'lib/lp/
>> --- lib/lp/
>> +++ lib/lp/
>> @@ -0,0 +1,322 @@
>> +# Copyright 2010 Canonical Ltd. This software is licensed under the
>> +# GNU Affero General Public License version 3 (see the file LICENSE).
>> +
>> +"""Job classes related to PersonTransferJob are in here."""
>
> s/ are in here//
Fixed. That's just odd. I'm blaming it on my rampant plagiarism in this branch.
>> +__metaclass__ = type
>> +__all__ = [
>> + 'MembershipNot
>> + 'PersonTransfe
>> + ]
>> +
>> +from lazr.delegates import delegates
>> +import simplejson
>> +from sqlobject import SQLObjectNotFound
>> +from storm.base import Storm
>> +from storm.expr import And
>> +from storm.locals import (
>> + Int,
>> + Reference,
>> + Unicode,
>> + )
>> +from zope.component import getUtility
>> +from zope.interface import (
>> + classProvides,
>> + implements,
>> + )
>> +
>> +
>
> extra blank line
Fixed with henning's tool.
>> +from canonical.config import config
>> +from canonical.
>> +from canonical.
>> + get_contact_
>> + get_email_
>> + )
>> +from canonical.
>> + IMasterStore,
>> + IStore,
>> + )
>> +from canonical.
>> + format_address,
>> + simple_sendmail,
>> + )
>> +from canonical.
>> +from canonical.
>> +
>> +
>
> Hmmm, two of them. is there supposed to be two? did you do that
> manually or did henning's tool do it? if the latter, then keep it.
Fixed. I really need to update my vim plugin.
>> +from lp.registry.enum import PersonTransferJ
>> +from lp.registry.
>> + IPerson,
>> + IPersonSet,
>> + ITeam,
>> + )
>> +from lp.registry.
>> + IPersonTransfe
>> + IPersonTransfe
>> + IMembershipNot
>> + IMembershipNot
>> + )
>> +from lp.registry.
>> +from lp.registry.
>> +from lp.services.
>> +from lp.services.
>> +
>> +
>> +class PersonTransferJ
> [...]
>> + def __init__(self, minor_person, major_person, job_type, metadata):
>> + """Constructor.
>> +
>> + :param minor_person: The person or team being added to or removed
>> + from the major_person.
>> + :param major_person: The person or team that is receiving or losing
>> + the minor person.
>> + :param job_type: The specific membership action b...

Hi Edwin,
Very interesting branch. I've got some suggestions but overall it is great.
--Brad
> === added file 'lib/lp/ registry/ model/persontra nsferjob. py' registry/ model/persontra nsferjob. py 1970-01-01 00:00:00 +0000 registry/ model/persontra nsferjob. py 2010-09-17 18:59:05 +0000
> --- lib/lp/
> +++ lib/lp/
> @@ -0,0 +1,322 @@
> +# Copyright 2010 Canonical Ltd. This software is licensed under the
> +# GNU Affero General Public License version 3 (see the file LICENSE).
> +
> +"""Job classes related to PersonTransferJob are in here."""
s/ are in here//
> +__metaclass__ = type ficationJob' , Job',
> +__all__ = [
> + 'MembershipNoti
> + 'PersonTransfer
> + ]
> +
> +from lazr.delegates import delegates
> +import simplejson
> +from sqlobject import SQLObjectNotFound
> +from storm.base import Storm
> +from storm.expr import And
> +from storm.locals import (
> + Int,
> + Reference,
> + Unicode,
> + )
> +from zope.component import getUtility
> +from zope.interface import (
> + classProvides,
> + implements,
> + )
> +
> +
extra blank line
> +from canonical.config import config database. enumcol import EnumCol launchpad. helpers import ( email_addresses , launchpad. interfaces. lpstorm import ( launchpad. mail import ( launchpad. mailnotificatio n import MailWrapper launchpad. webapp import canonical_url
> +from canonical.
> +from canonical.
> + get_contact_
> + get_email_template,
> + )
> +from canonical.
> + IMasterStore,
> + IStore,
> + )
> +from canonical.
> + format_address,
> + simple_sendmail,
> + )
> +from canonical.
> +from canonical.
> +
> +
Hmmm, two of them. is there supposed to be two? did you do that
manually or did henning's tool do it? if the latter, then keep it.
> +from lp.registry.enum import PersonTransferJ obType interfaces. person import ( interfaces. persontransferj ob import ( JobSource, ficationJob, ficationJobSour ce, interfaces. teammembership import TeamMembershipS tatus model.person import Person job.model. job import Job job.runner import BaseRunnableJob ob(Storm) :
> +from lp.registry.
> + IPerson,
> + IPersonSet,
> + ITeam,
> + )
> +from lp.registry.
> + IPersonTransferJob,
> + IPersonTransfer
> + IMembershipNoti
> + IMembershipNoti
> + )
> +from lp.registry.
> +from lp.registry.
> +from lp.services.
> +from lp.services.
> +
> +
> +class PersonTransferJ
[...]
> + def __init__(self, minor_person, major_person, job_type, metadata):
> + """Constructor.
> +
> + :param minor_person: The person or team being added to or removed
> + from the major_person.
> + :param major_person: The person or team that is receiving or losing
> + the minor person.
> + :param job_type: The specific membership action being performed.
> + :param metadata: The type-specific variables, as a JSON-compatible
> + dict.
Indent to match.
> + """ nsferJob, self).__init__()
> + super(PersonTra
> + self.job = Job()
> + self.job_type = job_type
> + self.major_person = major_person
> + self.minor_person = minor_person
> +
> + json_data = simplejson.dump...