Modify

Opened 4 months ago

Closed 4 months ago

Last modified 4 months ago

#11698 closed defect (fixed)

AttributeError: 'FakeRequest' object has no attribute 'authname'

Reported by: hasienda Owned by: hasienda
Priority: normal Component: TracHacksPlugin
Severity: normal Keywords: request Mock
Cc: otaku42 Trac Release:

Description

This was reported on 10-Apr-2014 by Paul Tobias via th-users mailing list, but appeared with rather big delay only today. It was rather easy to track it down to the new tag change recording, that requires evaluation of req.authname, which is not take care for in trachacks.util.FakeRequest.

The trivial fix - including excessive white-space cleanup - is straight-forward:

  • trachacksplugin/0.11/trachacks/util.py

    diff --git a/trachacksplugin/0.11/trachacks/util.py b/trachacksplugin/0.11/trachacks/util.py
    a b  
    1313 
    1414 
    1515class FakeRequest(object): 
    16     def __init__(self, env, authname = 'anonymous'): 
     16    def __init__(self, env, authname='anonymous'): 
     17        self.authname = authname 
    1718        self.perm = PermissionCache(env, authname) 
    1819 
    1920 

Attachments (0)

Change History (4)

comment:1 Changed 4 months ago by rjollos

In 13876:

Fixed an AttributeError exception in TracHacksHtPasswdStore.save_changes (IAccountChangeListener implementation) due to missing authname attribute of FakeRequest class. Refs #11698.

TagsPlugin 0.7 requires an authname attribute on the Request object in order to record the tags change history. Bumped TracTags requirement from 0.7dev to 0.7.

Patch by Steffen Hoffmann.

comment:2 Changed 4 months ago by rjollos

In 13877:

3.0dev: PEP-0008 changes. Refs #11698.

comment:3 Changed 4 months ago by rjollos

  • Resolution set to fixed
  • Status changed from new to closed

comment:4 Changed 4 months ago by rjollos

  • Owner changed from rjollos to hasienda

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.