Opened 8 years ago

Closed 8 years ago

#7316 closed defect (fixed)

NameError: global name 'legacy_action' is not defined

Reported by: ak@… Owned by: Malcolm Studd
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@… 8 years ago.
Bugfix for legacy action error message.

Download all attachments as: .zip

Change History (3)

Changed 8 years ago by ak@…

Attachment: LegacyActionErrorFix.patch added

Bugfix for legacy action error message.

comment:1 Changed 8 years ago by Lucas Rangit MAGASWERAN

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 8 years ago by Malcolm Studd

Resolution: fixed
Status: newclosed

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.

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain Malcolm Studd.
The resolution will be deleted.

Add Comment

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

Note: See TracTickets for help on using tickets.