| Index: sitescripts/reports/web/updateReport.py |
| =================================================================== |
| --- a/sitescripts/reports/web/updateReport.py |
| +++ b/sitescripts/reports/web/updateReport.py |
| @@ -14,19 +14,18 @@ |
| # along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. |
| import re |
| -import os |
| -import sys |
| import random |
| from urlparse import parse_qsl |
| -from sitescripts.utils import get_config, get_template, setupStderr |
| +from sitescripts.utils import get_config, get_template |
| from sitescripts.web import url_handler |
| -from sitescripts.reports.utils import calculateReportSecret, calculateReportSecret_compat, getReport, saveReport, sendUpdateNotification, getUserId, updateUserUsefulness |
| +from sitescripts.reports.utils import (calculateReportSecret, |
| + calculateReportSecret_compat, getReport, |
| + saveReport, sendUpdateNotification, |
| + getUserId, updateUserUsefulness) |
| @url_handler('/updateReport') |
| def handleRequest(environ, start_response): |
| - setupStderr(environ['wsgi.errors']) |
| - |
| if environ['REQUEST_METHOD'].upper() != 'POST' or not environ.get('CONTENT_TYPE', '').startswith('application/x-www-form-urlencoded'): |
| return showError('Unsupported request method', start_response) |
| @@ -59,6 +58,7 @@ |
| oldusefulness = reportData.get('usefulness', '0') |
| reportData['usefulness'] = params.get('usefulness', '0') |
| + |
| if 'email' in reportData: |
| updateUserUsefulness(getUserId(reportData['email']), reportData['usefulness'], oldusefulness) |