Edgewall Software
Modify

Opened 9 years ago

Closed 9 years ago

#12134 closed defect (fixed)

Exception: Missing permissions to report spam

Reported by: Ryan J Ollos Owned by: Dirk Stöcker
Priority: normal Milestone: plugin - spam-filter
Component: plugin/spamfilter Version:
Severity: normal Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

How to Reproduce

While doing a GET operation on /reportspam, Trac issued an internal error.

(please provide additional details here)

Request parameters:

{}

User agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:38.0) Gecko/20100101 Firefox/38.0

System Information

System information not available

Enabled Plugins

Plugin information not available

Python Traceback

Traceback (most recent call last):
  File "build/bdist.linux-i686/egg/trac/web/main.py", line 550, in _dispatch_request
    dispatcher.dispatch(req)
  File "build/bdist.linux-i686/egg/trac/web/main.py", line 243, in dispatch
    resp = chosen_handler.process_request(req)
  File "/srv/trac-hacks.org/pve/lib/python2.6/site-packages/TracSpamFilter-1.0.6.dev0-py2.6.egg/tracspamfilter/report.py", line 40, in process_request
    raise Exception(_("Missing permissions to report spam"))
Exception: Missing permissions to report spam

Attachments (1)

t12134_missing_imports.patch (1.6 KB ) - added by Ryan J Ollos 9 years ago.

Download all attachments as: .zip

Change History (5)

comment:1 by Ryan J Ollos, 9 years ago

I suggest the following untested changes to plugins/1.0/spam-filter/tracspamfilter/report.py@13308:39-42#L25:

-        if not 'SPAM_REPORT' in req.perm:
-            raise Exception(_("Missing permissions to report spam"))
-         if not 'page' in req.args:
-             raise Exception(_("No page supplied to report as spam"))
+        req.perm.require('SPAM_REPORT')
+        if 'page' not in req.args:
+            raise TracError(_("No page supplied to report as spam"))

TracError will need to be imported on line 19.

by Ryan J Ollos, 9 years ago

comment:2 by Ryan J Ollos, 9 years ago

The attached patch (attachment:t12134_missing_imports.patch) is unrelated to the error reported in this ticket, but fixes some missing imports and an unbound reference error.

comment:3 by Ryan J Ollos, 9 years ago

Milestone: plugin - spam-filter

comment:4 by Ryan J Ollos, 9 years ago

Resolution: fixed
Status: newclosed

Fixed in [14339:14340].

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Dirk Stöcker.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Dirk Stöcker to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.