Edgewall Software
Modify

Opened 9 years ago

Closed 9 years ago

Last modified 8 years ago

#12172 closed defect (fixed)

AttributeError: 'FakeSession' object has no attribute 'authenticated'

Reported by: Ryan J Ollos Owned by: Jun Omae
Priority: normal Milestone: 1.2
Component: web frontend Version:
Severity: normal Keywords:
Cc: Branch:
Release Notes:

Fixed 'AttributeError: FakeSession' object has no attribute 'authenticated' error, due to missing attributes on DetachedSession class.

API Changes:

FakeSession has attributes of DetachedSession.

Internal Changes:

Description

This was initially reported in comment:11:ticket:12129.

2015-07-27 04:09:41,414 Trac[main] ERROR: Exception caught while post-processing request:
Traceback (most recent call last):
  File "build/bdist.linux-i686/egg/trac/web/main.py", line 274, in dispatch
    self._post_process_request(req)
  File "build/bdist.linux-i686/egg/trac/web/main.py", line 387, in _post_process_request
    f.post_process_request(req, *(None,)*extra_arg_count)
  File "/srv/trac-hacks.org/pve/lib/python2.6/site-packages/TracAccountManager-0.4.3-py2.6.egg/acct_mgr/register.py", line 509, in post_process_request
    if not req.session.authenticated:
AttributeError: 'FakeSession' object has no attribute 'authenticated'
2015-07-27 04:09:41,415 Trac[main] ERROR: Internal Server Error:
Traceback (most recent call last):
  File "build/bdist.linux-i686/egg/trac/web/main.py", line 551, in _dispatch_request
    dispatcher.dispatch(req)
  File "build/bdist.linux-i686/egg/trac/web/main.py", line 209, in dispatch
    self._pre_process_request(req, chosen_handler)
  File "build/bdist.linux-i686/egg/trac/web/main.py", line 372, in _pre_process_request
    chosen_handler = filter_.pre_process_request(req, chosen_handler)
  File "/srv/trac-hacks.org/pve/lib/python2.6/site-packages/TracAccountManager-0.4.3-py2.6.egg/acct_mgr/register.py", line 479, in pre_process_request
    if not req.session.authenticated:
AttributeError: 'FakeSession' object has no attribute 'authenticated'

The proposed fix is:

  • trac/web/main.py

    diff --git a/trac/web/main.py b/trac/web/main.py
    index 909d75ec0..728141655 100644
    a b default_tracker = 'http://trac.edgewall.org'  
    6262
    6363class FakeSession(dict):
    6464    sid = None
     65    authenticated = False
     66    last_visit = 0
    6567    def save(self):
    6668        pass
    6769

Attachments (0)

Change History (6)

comment:1 by Ryan J Ollos, 9 years ago

Milestone: 1.0.91.0.10

Moving tickets that appear to be uncompleted for milestone:1.0.9. Please move back to milestone:1.0.9 if the ticket can be completed by 2015-09-07 18:00 UTC.

comment:2 by Ryan J Ollos, 9 years ago

Owner: set to Ryan J Ollos
Status: newassigned

comment:3 by Ryan J Ollos, 9 years ago

Milestone: 1.0.101.2
Resolution: fixed
Status: assignedclosed

Committed to trunk in [14385].

comment:4 by Ryan J Ollos, 9 years ago

Owner: changed from Ryan J Ollos to Jun Omae

comment:5 by Ryan J Ollos, 9 years ago

API Changes: modified (diff)

comment:6 by Ryan J Ollos, 8 years ago

Release Notes: modified (diff)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jun Omae.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Jun Omae 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.