Merge branch 'main' into avm99963-monorail
Merged commit 3779da353b36d43cf778e7d4f468097714dd4540
GitOrigin-RevId: 6451a5c6b75afb0fd1f37b3f14521148d0722ea8
diff --git a/features/notify.py b/features/notify.py
index 425041e..230cbf5 100644
--- a/features/notify.py
+++ b/features/notify.py
@@ -219,11 +219,8 @@
return email_tasks
- # def GetNotifyIssueChangeTask(self, **kwargs):
- # return self.handler(**kwargs)
-
- # def PostNotifyIssueChangeTask(self, **kwargs):
- # return self.handler(**kwargs)
+ def PostNotifyIssueChangeTask(self, **kwargs):
+ return self.handler(**kwargs)
class NotifyBlockingChangeTask(notify_helpers.NotifyTaskBase):
@@ -356,11 +353,8 @@
return one_issue_email_tasks
- # def GetNotifyBlockingChangeTask(self, **kwargs):
- # return self.handler(**kwargs)
-
- # def PostNotifyBlockingChangeTask(self, **kwargs):
- # return self.handler(**kwargs)
+ def PostNotifyBlockingChangeTask(self, **kwargs):
+ return self.handler(**kwargs)
class NotifyBulkChangeTask(notify_helpers.NotifyTaskBase):
@@ -724,11 +718,8 @@
return subject, body
- # def GetNotifyBulkChangeTask(self, **kwargs):
- # return self.handler(**kwargs)
-
- # def PostNotifyBulkChangeTask(self, **kwargs):
- # return self.handler(**kwargs)
+ def PostNotifyBulkChangeTask(self, **kwargs):
+ return self.handler(**kwargs)
# For now, this class will not be used to send approval comment notifications
@@ -919,11 +910,8 @@
return list(set(recipient_ids))
- # def GetNotifyApprovalChangeTask(self, **kwargs):
- # return self.handler(**kwargs)
-
- # def PostNotifyApprovalChangeTask(self, **kwargs):
- # return self.handler(**kwargs)
+ def PostNotifyApprovalChangeTask(self, **kwargs):
+ return self.handler(**kwargs)
class NotifyRulesDeletedTask(notify_helpers.NotifyTaskBase):
@@ -991,15 +979,11 @@
return email_tasks
- # def GetNotifyRulesDeletedTask(self, **kwargs):
- # return self.handler(**kwargs)
-
- # def PostNotifyRulesDeletedTask(self, **kwargs):
- # return self.handler(**kwargs)
+ def PostNotifyRulesDeletedTask(self, **kwargs):
+ return self.handler(**kwargs)
-# TODO: change to FlaskInternalTask when convert to flask
-class OutboundEmailTask(jsonfeed.InternalTask):
+class OutboundEmailTask(jsonfeed.FlaskInternalTask):
"""JSON servlet that sends one email.
Handles tasks enqueued from notify_helpers._EnqueueOutboundEmail.
@@ -1018,9 +1002,9 @@
# To avoid urlencoding the email body, the most salient parameters to this
# method are passed as a json-encoded POST body.
try:
- email_params = json.loads(self.request.body)
+ email_params = json.loads(self.request.get_data(as_text=True))
except ValueError:
- logging.error(self.request.body)
+ logging.error(self.request.get_data(as_text=True))
raise
# If running on a GAFYD domain, you must define an app alias on the
# Application Settings admin web page.
@@ -1085,8 +1069,5 @@
sender=sender, to=to, subject=subject, body=body, html_body=html_body,
reply_to=reply_to, references=references)
- # def GetOutboundEmailTask(self, **kwargs):
- # return self.handler(**kwargs)
-
- # def PostOutboundEmailTask(self, **kwargs):
- # return self.handler(**kwargs)
+ def PostOutboundEmailTask(self, **kwargs):
+ return self.handler(**kwargs)