| Index: sitescripts/reports/web/updateReport.py |
| =================================================================== |
| --- a/sitescripts/reports/web/updateReport.py |
| +++ b/sitescripts/reports/web/updateReport.py |
| @@ -14,17 +14,19 @@ |
| # 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.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'): |
| @@ -44,7 +46,7 @@ |
| if not re.match(r'^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$', guid): |
| return showError('Invalid or missing report GUID', start_response) |
| - reportData = getReport(guid) |
| + reportData = getReport(guid) # WSGIAppError: OperationalError(2003, "Can't connect to MySQL server on 'localhost' ([Errno 111] Connection refused)") |
| if reportData == None: |
| return showError('Report does not exist', start_response) |
| @@ -62,7 +64,7 @@ |
| if 'email' in reportData: |
| updateUserUsefulness(getUserId(reportData['email']), reportData['usefulness'], oldusefulness) |
| - saveReport(guid, reportData) |
| + saveReport(guid, reportData) # WSGIAppError: OperationalError(2003, "Can't connect to MySQL server on 'localhost' ([Errno 111] Connection refused)") |
| if params.get('notify', '') and 'email' in reportData: |
| email = reportData['email'] |