Modify

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#11698 closed defect (fixed)

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

Reported by: Steffen Hoffmann Owned by: Steffen Hoffmann
Priority: normal Component: TracHacksPlugin
Severity: normal Keywords: request Mock
Cc: Michael Renzmann 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 11 years ago by Ryan J Ollos

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 11 years ago by Ryan J Ollos

In 13877:

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

comment:3 Changed 11 years ago by Ryan J Ollos

Resolution: fixed
Status: newclosed

comment:4 Changed 11 years ago by Ryan J Ollos

Owner: changed from Ryan J Ollos to Steffen Hoffmann

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Steffen Hoffmann.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


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

 
Note: See TracTickets for help on using tickets.