Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(461)

Unified Diff: handlers/policy_checklist/handler.py

Issue 23576004: Don't send mail for policy_checklist comments. (Closed) Base URL: https://git.chromium.org/git/chromium/tools/reviewbot.git@master
Patch Set: Address feedback. Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | rietveld.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: handlers/policy_checklist/handler.py
diff --git a/handlers/policy_checklist/handler.py b/handlers/policy_checklist/handler.py
index ec26e37749cf3f5abf4070fbd979c720e320f989..a2153eb0cd0d3532ca7140e6de822838d97f46f8 100644
--- a/handlers/policy_checklist/handler.py
+++ b/handlers/policy_checklist/handler.py
@@ -31,6 +31,16 @@ JINJA_ENVIRONMENT = jinja2.Environment(
loader=jinja2.FileSystemLoader(os.path.dirname(__file__)))
+def prepare_address_list(addr, email_list):
+ """Prepares |email_list| for use as rietveld query parameter.
+
+ Canonicalizes the entries in |email_list|, removes any occurrences of |addr|,
+ joins the entries with commas and returns the result.
+ """
+ return ','.join([util.canonicalize_email(entry)
+ for entry in email_list if entry != addr])
+
+
def process(addr, message, review, rietveld):
"""Handles reviews for chrome/app/policy/policy_templates.json.
@@ -78,4 +88,7 @@ def process(addr, message, review, rietveld):
# Finally, post all inline comments.
if len(chunks) > 0:
template = JINJA_ENVIRONMENT.get_template(REVIEW_MESSAGE_TEMPLATE)
- rietveld.post_comment(review.issue_id, template.render(review=review), True)
+ rietveld.publish_inline_comments(
+ review.issue_id, template.render(review=review),
+ prepare_address_list(addr, review.issue_data.reviewers),
+ prepare_address_list(addr, review.issue_data.cc))
« no previous file with comments | « no previous file | rietveld.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698