Opened 7 years ago
Closed 6 years ago
#3873 closed defect (fixed)
Internal Error when adding permission already granted
| Reported by: | tom.fiala@… | Owned by: | cboos |
|---|---|---|---|
| Priority: | normal | Milestone: | 0.11 |
| Component: | admin/web | Version: | devel |
| Severity: | minor | Keywords: | |
| Cc: | |||
| Release Notes: | |||
| API Changes: | |||
Description (last modified by cboos)
I received an internal error when trying to assign an already assigned admin permission to a subject. I would have expected an error message informing me the permission was already assigned. Here is the trace log: Python Traceback
Traceback (most recent call last):
File "/usr/local/python/lib/python2.4/site-packages/trac/web/main.py", line 339, in dispatch_request
dispatcher.dispatch(req)
File "/usr/local/python/lib/python2.4/site-packages/trac/web/main.py", line 224, in dispatch
resp = chosen_handler.process_request(req)
File "/usr/local/python-2.4/lib/python2.4/site-packages/TracWebAdmin-0.1.1dev_r2765-py2.4.egg/webadmin/web_ui.py", line 106, in process_request
path_info)
File "/usr/local/python-2.4/lib/python2.4/site-packages/TracWebAdmin-0.1.1dev_r2765-py2.4.egg/webadmin/perm.py", line 45, in process_admin_request
perm.grant_permission(subject, action)
File "/usr/local/python/lib/python2.4/site-packages/trac/perm.py", line 190, in grant_permission
self.store.grant_permission(username, action)
File "/usr/local/python/lib/python2.4/site-packages/trac/perm.py", line 143, in grant_permission
(username, action))
File "/usr/local/python/lib/python2.4/site-packages/trac/db/util.py", line 47, in execute
return self.cursor.execute(sql_escape_percent(sql), args)
File "/usr/local/python/lib/python2.4/site-packages/trac/db/sqlite_backend.py", line 44, in execute
args or [])
File "/usr/local/python/lib/python2.4/site-packages/trac/db/sqlite_backend.py", line 36, in _rollback_on_error
return function(self, *args, **kwargs)
IntegrityError: columns username, action are not unique
Attachments (1)
Change History (8)
comment:1 Changed 7 years ago by cboos
- Description modified (diff)
- Milestone set to 0.10.1
- Severity changed from normal to minor
comment:2 Changed 7 years ago by cmlenz
- Component changed from general to webadmin
- Milestone changed from 0.10.1 to 0.11
- Owner changed from jonas to cmlenz
comment:3 Changed 7 years ago by cmlenz
- Version changed from 0.10 to devel
comment:4 Changed 6 years ago by cboos
- Owner changed from cmlenz to cboos
- Status changed from new to assigned
No need for an error I think. In the future, a warning would be enough.
comment:5 Changed 6 years ago by cboos
The "internal error" issue is fixed in r5190, I'll look into adding a generic warning mechanism.
Changed 6 years ago by cboos
Display general warnings, and application to the problem discussed in this ticket.
comment:6 Changed 6 years ago by cboos
- Keywords review added
… something like attachment:warn_permission_exists-r5190.diff.
comment:7 Changed 6 years ago by cboos
- Keywords review removed
- Resolution set to fixed
- Status changed from assigned to closed
- Summary changed from Trac Internal Error to Internal Error when adding permission already granted



Right, the error message could be more "friendly".