Merge branch 'main' into avm99963-monorail
Merged commit 3779da353b36d43cf778e7d4f468097714dd4540
GitOrigin-RevId: 6451a5c6b75afb0fd1f37b3f14521148d0722ea8
diff --git a/framework/deleteusers.py b/framework/deleteusers.py
index 739782e..015fad4 100644
--- a/framework/deleteusers.py
+++ b/framework/deleteusers.py
@@ -32,8 +32,7 @@
return credentials.authorize(httplib2.Http(timeout=60))
-# TODO: change to FlaskInternalTask when convert to Flask
-class WipeoutSyncCron(jsonfeed.InternalTask):
+class WipeoutSyncCron(jsonfeed.FlaskInternalTask):
"""Enqueue tasks for sending user lists to wipeout-lite and deleting deleted
users fetched from wipeout-lite."""
@@ -62,15 +61,11 @@
cloud_tasks_helpers.create_task(
task, queue=framework_constants.QUEUE_FETCH_WIPEOUT_DELETED_USERS)
- # def GetWipeoutSyncCron(self, **kwargs):
- # return self.handler(**kwargs)
-
- # def PostWipeoutSyncCron(self, **kwargs):
- # return self.handler(**kwargs)
+ def GetWipeoutSyncCron(self, **kwargs):
+ return self.handler(**kwargs)
-# TODO: Set to FlaskInternalTask when convert
-class SendWipeoutUserListsTask(jsonfeed.InternalTask):
+class SendWipeoutUserListsTask(jsonfeed.FlaskInternalTask):
"""Sends a batch of monorail users to wipeout-lite."""
def HandleRequest(self, mr):
@@ -95,15 +90,11 @@
logging.info(
'Received response, %s with contents, %s', resp, data)
- # def GetSendWipeoutUserListsTask(self, **kwargs):
- # return self.handler(**kwargs)
-
- # def PostSendWipeoutUserListsTask(self, **kwargs):
- # return self.handler(**kwargs)
+ def PostSendWipeoutUserListsTask(self, **kwargs):
+ return self.handler(**kwargs)
-# TODO: Set to FlaskInternalTask when convert
-class DeleteWipeoutUsersTask(jsonfeed.InternalTask):
+class DeleteWipeoutUsersTask(jsonfeed.FlaskInternalTask):
"""Fetches deleted users from wipeout-lite and enqueues tasks to delete
those users from Monorail's DB."""
@@ -137,15 +128,11 @@
'Received response, %s with contents, %s', resp, data)
return json.loads(data)
- # def GetDeleteWipeoutUsersTask(self, **kwargs):
- # return self.handler(**kwargs)
-
- # def PostDeleteWipeoutUsersTask(self, **kwargs):
- # return self.handler(**kwargs)
+ def PostDeleteWipeoutUsersTask(self, **kwargs):
+ return self.handler(**kwargs)
-# TODO: Set to FlaskInternalTask when convert
-class DeleteUsersTask(jsonfeed.InternalTask):
+class DeleteUsersTask(jsonfeed.FlaskInternalTask):
"""Deletes users from Monorail's DB."""
def HandleRequest(self, mr):
@@ -160,8 +147,5 @@
with work_env.WorkEnv(mr, self.services) as we:
we.ExpungeUsers(emails, check_perms=False)
- # def GetDeleteUsersTask(self, **kwargs):
- # return self.handler(**kwargs)
-
- # def PostDeleteUsersTask(self, **kwargs):
- # return self.handler(**kwargs)
+ def PostDeleteUsersTask(self, **kwargs):
+ return self.handler(**kwargs)