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

Unified Diff: sitescripts/reports/web/updateReport.py

Issue 8625042: Reports - user usefullness (Closed)
Patch Set: Reports - user usefulness Created Oct. 29, 2012, 12: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/reports/utils.py ('k') | sitescripts/utils.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sitescripts/reports/web/updateReport.py
===================================================================
--- a/sitescripts/reports/web/updateReport.py
+++ b/sitescripts/reports/web/updateReport.py
@@ -8,7 +8,7 @@
from urlparse import parse_qsl
from sitescripts.utils import get_config, get_template, setupStderr
from sitescripts.web import url_handler
-from sitescripts.reports.utils import calculateReportSecret, calculateReportSecret_compat, getReport, saveReport, sendUpdateNotification
+from sitescripts.reports.utils import calculateReportSecret, calculateReportSecret_compat, getReport, saveReport, sendUpdateNotification, getUserId, updateUserUsefulness
@url_handler('/updateReport')
def handleRequest(environ, start_response):
@@ -44,6 +44,11 @@
if len(reportData['status']) > 1024:
reportData['status'] = reportData['status'][:1024]
+ oldusefulness = reportData['usefulness']
+ reportData['usefulness'] = params.get('usefulness', '0')
+ if ('email' in reportData):
+ updateUserUsefulness(getUserId(reportData['email']), reportData['usefulness'], oldusefulness)
+
saveReport(guid, reportData)
if params.get('notify', '') and 'email' in reportData:
« no previous file with comments | « sitescripts/reports/utils.py ('k') | sitescripts/utils.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld