Modify ↓
#9697 closed defect (fixed)
"KeyError: captcha_redirect" after logging in during captcha
| Reported by: | anonymous | 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
Steps to reproduce:
- Log out of Trac
- Attempt to add a comment on a ticket. (This redirects to captcha.)
- Log in. (This returns user to captcha page.)
- Submit captcha
Expected result: Comment submits successfully on step 4, or user is redirected to a non-captcha page on step 3.
Actual result:
2010-10-17 19:47:53,709 Trac[main] ERROR: Internal Server Error:
Traceback (most recent call last):
File "/usr/local/lib/python2.6/dist-packages/Trac-0.12-py2.6.egg/trac/web/main.py", line 513, in _dispatch_request
dispatcher.dispatch(req)
File "/usr/local/lib/python2.6/dist-packages/Trac-0.12-py2.6.egg/trac/web/main.py", line 200, in dispatch
chosen_handler)
File "/usr/local/lib/python2.6/dist-packages/Trac-0.12-py2.6.egg/trac/web/main.py", line 346, in _pre_process_request
chosen_handler = filter_.pre_process_request(req, chosen_handler)
File "/usr/local/lib/python2.6/dist-packages/TracSpamFilter-0.4.1dev_r10170-py2.6.egg/tracspamfilter/captcha/api.py", line 119, in pre_process_request
del req.session['captcha_redirect']
KeyError: 'captcha_redirect'
Attachments (0)
Change History (2)
comment:1 by , 15 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
comment:2 by , 15 years ago
You should rather use the in operator to check for a key in a dictionary:
if 'captcha_redirect' in req.session: del req.session['captcha_redirect']
Note:
See TracTickets
for help on using tickets.



In r10276.