Opened 11 years ago
Closed 8 years ago
#11312 closed defect (fixed)
Variable `user' does not exist (api.py around lines 410~420)
Reported by: | Pierre-Yves Strub | Owned by: | Steffen Hoffmann |
---|---|---|---|
Priority: | normal | Component: | AccountManagerPlugin |
Severity: | normal | Keywords: | |
Cc: | Trac Release: | 0.11 |
Description
See attached patch for a fix.
Attachments (1)
Change History (10)
Changed 11 years ago by
Attachment: | 0001-bug-fix-local-variable-user-does-not-exist.patch added |
---|
comment:1 follow-ups: 2 3 Changed 11 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
Trac Release: | 1.0 → 0.11 |
comment:2 Changed 11 years ago by
Replying to hasienda:
The patch has been done w.r.t trunk, in this case:
https://trac-hacks.org/svn/accountmanagerplugin/trunk
If trunk is not the head of your dev., could you tell me where the current development of the plugin takes place? Otherwise, line 419 is the exact line number. I indeed have local modifications, but the patch applies without any fuzziness on a fresh checkout of trunk.
To reproduce, on an unmodified trunk, take any password store that raises an exception in IPasswordStore.set_password before having creating the user. (The htpassword backend with a read-only password file will do it) Go to the administration panel for creating a user. At creation, you'll end with the following exception:
Trac detected an internal error: NameError: global name 'user' is not def File "/home/strub/Projects/Trac/trac-env/local/lib/python2.7/site-packages/trac/web/main.py", line 497, in _dispatch_request File "/home/strub/Projects/Trac/trac-env/local/lib/python2.7/site-packages/trac/web/main.py", line 214, in dispatch File "/home/strub/Projects/Trac/trac-env/local/lib/python2.7/site-packages/trac/admin/web_ui.py", line 125, in process_request File "build/bdist.linux-i686/egg/acct_mgr/admin.py", line 231, in render_admin_panel File "build/bdist.linux-i686/egg/acct_mgr/admin.py", line 865, in _do_users File "build/bdist.linux-i686/egg/acct_mgr/admin.py", line 1207, in _do_add File "build/bdist.linux-i686/egg/acct_mgr/api.py", line 389, in validate_account File "build/bdist.linux-i686/egg/acct_mgr/api.py", line 419, in _create_user
Regarding your last question, I'm currently defining some new interfaces s.t. users can record some credential payloads that can then be used by other plugins for authentication.
comment:3 follow-up: 4 Changed 11 years ago by
Replying to hasienda:
In fact, neither does current `trunk` code contain the old line referenced in your patch nor does that line even exist in current stable (0.4.3).
You may want to take another look. Unless my mind is completely shot this evening, it looks like the patch applies directly to the lines that you point to with the TracLink.
comment:4 Changed 11 years ago by
Resolution: | invalid |
---|---|
Status: | closed → reopened |
Replying to rjollos:
You may want to take another look. Unless my mind is completely shot this evening, it looks like the patch applies directly to the lines that you point to with the TracLink.
Hm, dunno why, but I've been aiming at line 416 instead of 419, indeed. Sorry.
comment:5 Changed 11 years ago by
Status: | reopened → new |
---|
comment:7 Changed 11 years ago by
Well, this ticket could be closed, arguing there is no stable release out there with this bug. But let's stick to my usual habit to keep tickets open until next release, maybe for the sake of other early adopters to note the issue more easily.
comment:8 Changed 10 years ago by
Status: | new → accepted |
---|
comment:9 Changed 8 years ago by
Resolution: | → fixed |
---|---|
Status: | accepted → closed |
Why does your patch try to fix something, that is not broken?
In fact, neither does current `trunk` code contain the old line referenced in your patch nor does that line even exist in current stable (0.4.3). AFAIKS the relevant code has been put in place with revision [13290] - almost three months ago, too late for last stable release - and has never been changed so far. You must be looking at a side-effect of local modifications to your copy of the source, if you see need for the proposed fix.
I cannot see another explanation, sorry. Proof me wrong, if you can, but you'll need to tell me exactly where to apply the fix too.
Anyway, I'd be even more interested in what and why you change the API source, so that we could probably learn something for the official development branch.?