Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: sitescripts/submit_email/web/submit_email.py

Issue 29323033: Issue 2846 - Service for processing Microsoft Edge announcement subscription (Closed)
Patch Set: Rename the ADBLOCKBROWSER_PRODUCT_NAME to DEFAULT_PRODUCT Created Aug. 19, 2015, 3:35 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sitescripts/submit_email/template/edge_verification.mail ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sitescripts/submit_email/web/submit_email.py
===================================================================
--- a/sitescripts/submit_email/web/submit_email.py
+++ b/sitescripts/submit_email/web/submit_email.py
@@ -26,6 +26,7 @@
from sitescripts.web import url_handler, form_handler, send_simple_response
VERIFICATION_PATH = '/verifyEmail'
+DEFAULT_PRODUCT = 'adblockbrowser'
def sign(config, data):
secret = config.get('submit_email', 'secret')
@@ -49,8 +50,12 @@
if lang:
params.append(('lang', lang))
+ product = data.get('product', DEFAULT_PRODUCT)
+ email_template = product + '_verification_email_template'
+ params.append(('product', product))
+
sendMail(
- config.get('submit_email', 'verification_email_template'),
+ config.get('submit_email', email_template),
{
'recipient': email,
'verification_url': '%s?%s' % (
@@ -79,7 +84,9 @@
'Invalid signature in verification request.'
)
- filename = config.get('submit_email', 'filename')
+ product = params.get('product', DEFAULT_PRODUCT)
+ filename = config.get('submit_email', product + '_filename')
+
with open(filename, 'ab', 0) as file:
fcntl.lockf(file, fcntl.LOCK_EX)
try:
« no previous file with comments | « sitescripts/submit_email/template/edge_verification.mail ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld