← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~ilasc/launchpad:permissions-close-account-job into launchpad:master

 

Ioana Lasc has proposed merging ~ilasc/launchpad:permissions-close-account-job into launchpad:master.

Commit message:
Adjust permissions for Close Account job

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~ilasc/launchpad/+git/launchpad/+merge/402019

Deleting the removeSecurityProxy for jobs will not cause the unit test to fail anymore. Previously without the removeSecurityProxy in place, unit test were failing exactly like the dogfood runs (https://pastebin.canonical.com/p/VS9KN6qGgP/).

Local CLI run of the job now: https://pastebin.canonical.com/p/tYq4vCwkQJ/
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~ilasc/launchpad:permissions-close-account-job into launchpad:master.
diff --git a/lib/lp/registry/configure.zcml b/lib/lp/registry/configure.zcml
index ac3d82b..2e05088 100644
--- a/lib/lp/registry/configure.zcml
+++ b/lib/lp/registry/configure.zcml
@@ -150,6 +150,10 @@
       <allow interface=".interfaces.persontransferjob.IPersonDeactivateJob"/>
     </class>
 
+    <class class=".model.persontransferjob.PersonCloseAccountJob">
+      <allow interface=".interfaces.persontransferjob.IPersonCloseAccountJob"/>
+    </class>
+
     <class class=".model.persontransferjob.TeamInvitationNotificationJob">
       <allow interface=".interfaces.persontransferjob.ITeamInvitationNotificationJob"/>
     </class>
diff --git a/lib/lp/registry/tests/test_person_close_account_job.py b/lib/lp/registry/tests/test_person_close_account_job.py
index f7a3da6..eb71135 100644
--- a/lib/lp/registry/tests/test_person_close_account_job.py
+++ b/lib/lp/registry/tests/test_person_close_account_job.py
@@ -53,7 +53,6 @@ class TestPersonCloseAccountJob(TestCaseWithFactory):
 
         getUtility(IPersonCloseAccountJobSource).create(user_to_delete)
         jobs = list(job_source.iterReady())
-        jobs[0] = removeSecurityProxy(jobs[0])
         with dbuser(config.IPersonCloseAccountJobSource.dbuser):
             JobRunner(jobs).runAll()
 
@@ -69,7 +68,6 @@ class TestPersonCloseAccountJob(TestCaseWithFactory):
             IPersonCloseAccountJobSource).create(user_to_delete)
         job_source = getUtility(IPersonCloseAccountJobSource)
         jobs = list(job_source.iterReady())
-        jobs[0] = removeSecurityProxy(jobs[0])
         with dbuser(config.IPersonCloseAccountJobSource.dbuser):
             JobRunner(jobs).runAll()
         self.assertEqual(JobStatus.COMPLETED, jobs[0].status)
diff --git a/lib/lp/services/config/schema-lazr.conf b/lib/lp/services/config/schema-lazr.conf
index 50ad59d..752093f 100644
--- a/lib/lp/services/config/schema-lazr.conf
+++ b/lib/lp/services/config/schema-lazr.conf
@@ -1798,6 +1798,7 @@ job_sources:
     IOCIRecipeRequestBuildsJobSource,
     IOCIRegistryUploadJobSource,
     IPackageUploadNotificationJobSource,
+    IPersonCloseAccountJobSource,
     IPersonDeactivateJobSource,
     IPersonMergeJobSource,
     IPlainPackageCopyJobSource,