Opened 4 years ago

Closed 4 years ago

#7316 closed defect (fixed)

NameError: global name 'legacy_action' is not defined

Reported by: ak@… Owned by: mestudd
Priority: normal Component: ExtendedVersionPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.11


Got the error message "NameError: global name 'legacy_action' is not defined" when clicking on a Version and the user does not have all required permissions. See attached file for a simple fix.

Attachments (1)

LegacyActionErrorFix.patch (445 bytes) - added by ak@… 4 years ago.
Bugfix for legacy action error message.

Download all attachments as: .zip

Change History (3)

Changed 4 years ago by ak@…

Bugfix for legacy action error message.

comment:1 Changed 4 years ago by lucasrangit

This patch fixed the issue for me. I would still like to understand from the following traceback what the permission issue was. Any ideas? Do you get the same traceback?

    resp = chosen_handler.process_request(req)
  File "/usr/local/lib/python2.6/dist-packages/ExtendedVersionTracPlugin-0.0-py2.6.egg/extendedversion/", lin
e 138, in process_request
    return self._render_view(req, db, version)
  File "/usr/local/lib/python2.6/dist-packages/ExtendedVersionTracPlugin-0.0-py2.6.egg/extendedversion/", lin
e 316, in _render_view
    'attachments': AttachmentModule(self.env).attachment_data(context),
  File "/usr/lib/python2.6/dist-packages/trac/", line 436, in attachment_data
    'can_create': 'ATTACHMENT_CREATE' in context.perm(new_att),
  File "/usr/lib/python2.6/dist-packages/trac/", line 524, in has_permission
    return self._has_permission(action, resource)
  File "/usr/lib/python2.6/dist-packages/trac/", line 538, in _has_permission
    check_permission(action, perm.username, resource, perm)
  File "/usr/lib/python2.6/dist-packages/trac/", line 425, in check_permission
  File "/usr/lib/python2.6/dist-packages/trac/", line 798, in check_permission
    resource, perm)
  File "/usr/local/lib/python2.6/dist-packages/ExtendedVersionTracPlugin-0.0-py2.6.egg/extendedversion/", line 85, in check_attachment_permission
    (username, resource, legacy_action))
NameError: global name 'legacy_action' is not defined

comment:2 Changed 4 years ago by mestudd

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

The issue was that the method called the action 'action' but 'legacy_action' when it went to print the log message.

I changed the name in the log statement, so this should be fixed in by r9265.

Add Comment

Modify Ticket

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

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

Note: See TracTickets for help on using tickets.