Description

Describe the bug...

Steps to reproduce

  1. Redefine user_form_fields to remove the 'name' item (I don't wish to allow a user form in my wiki, because users are always populated via single sign-on from the forum).
  2. Attempt to view any wiki page as an anonymous user.
  3. Get python AttributeError: User instance has no attribute 'name'

Please attach traceback.html

Example

user_form_fields = [
('css_url', _('User CSS URL'), "text", "40", _('(Leave it empty for disabling user CSS)')),
('edit_rows', _('Editor size'), "text", "3", ''),
]

Component selection

Details

I'm not a python expert, but for some reason the above change causes the User object not to have a ".name" property by default. When the system tries to get the default None user, the "elif self.name:" line fails, because this property doesn't exist.

MoinMoin Version

1.5.6

OS and Version Linux

2.4.etc

Python Version

2.4

Server Setup

Server Details

Language you are using the wiki in

en

Workaround

I added the line

self.name = ""

into the init of the User class so that the property would exist later in the function, but still fail the boolean test.

Discussion

Granted maybe this doesn't matter to 99.99% of all users of this wiki, but I still thought it was kind of strange that removing a field from a web form display would cause problems for a property in the User object.

Plan


CategoryMoinMoinBugFixed

MoinMoin: MoinMoinBugs/UserInstanceHasNoAttributeName (last edited 2008-03-18 19:37:04 by JohannesBerg)