Modify ↓
Opened 15 years ago
Closed 15 years ago
#7316 closed defect (fixed)
NameError: global name 'legacy_action' is not defined
| Reported by: | Owned by: | Malcolm Studd | |
|---|---|---|---|
| Priority: | normal | Component: | ExtendedVersionPlugin |
| Severity: | normal | Keywords: | |
| Cc: | Trac Release: | 0.11 |
Description
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)
Change History (3)
Changed 15 years ago by
| Attachment: | LegacyActionErrorFix.patch added |
|---|
comment:1 Changed 15 years ago by
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/version.py", 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/version.py", lin
e 316, in _render_view
'attachments': AttachmentModule(self.env).attachment_data(context),
File "/usr/lib/python2.6/dist-packages/trac/attachment.py", line 436, in attachment_data
'can_create': 'ATTACHMENT_CREATE' in context.perm(new_att),
File "/usr/lib/python2.6/dist-packages/trac/perm.py", line 524, in has_permission
return self._has_permission(action, resource)
File "/usr/lib/python2.6/dist-packages/trac/perm.py", line 538, in _has_permission
check_permission(action, perm.username, resource, perm)
File "/usr/lib/python2.6/dist-packages/trac/perm.py", line 425, in check_permission
perm)
File "/usr/lib/python2.6/dist-packages/trac/attachment.py", line 798, in check_permission
resource, perm)
File "/usr/local/lib/python2.6/dist-packages/ExtendedVersionTracPlugin-0.0-py2.6.egg/extendedversion/version.py", line 85, in check_attachment_permission
(username, resource, legacy_action))
NameError: global name 'legacy_action' is not defined
comment:2 Changed 15 years ago by
| Resolution: | → fixed |
|---|---|
| Status: | new → 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.
Note: See
TracTickets for help on using
tickets.



Bugfix for legacy action error message.