Opened 16 years ago
Closed 14 years ago
#3401 closed defect (fixed)
[patch] Removing email from preferences makes account unusable
Reported by: | Heikki Toivonen (remove -bugzilla when emailing directly) | Owned by: | John Hampton |
---|---|---|---|
Priority: | normal | Component: | AccountManagerPlugin |
Severity: | normal | Keywords: | user account corrupt |
Cc: | Trac Release: | 0.11 |
Description
I had just installed Trac with admin user and AccountManager plugin. I then logged in as admin, and changed the admin prefs to have a name and email address. (This actually limited the account since I had not yet set up outgoing email, but there is a separate bug for that.) I then decided I'd make the email field empty in the hopes that the situation would fix itself. Unfortunately doing that caused every page to show KeyError: 'email' while logged in as that user.
The way I recovered was to use trac-admin to create a new admin account, login with that, delete the old admin account, use trac-admin again to recreate the old admin account, set up working email for admin, and finally delete the second admin account.
Attachments (2)
Change History (11)
comment:1 Changed 16 years ago by
comment:2 Changed 16 years ago by
I had the same problem. (Trac 0.11.2, TracAccountManager-0.2.1dev). My investigation lead to the attached patch.
Changed 16 years ago by
comment:3 Changed 16 years ago by
You may want to take a look at #4125, there is another patch that tries to fix this part of code
comment:4 Changed 16 years ago by
Owner: | changed from Matt Good to John Hampton |
---|---|
Status: | new → assigned |
comment:5 Changed 16 years ago by
Added a patch against r5836 which also prevents the AccountManagerPlugin from sending an verification email and displaying a warn message if the email adress is empty.
comment:6 Changed 15 years ago by
comment:7 Changed 15 years ago by
comment:8 follow-up: 9 Changed 15 years ago by
With the patch from manski the original issue should be fixed. I've committed the patch to 0.11 and trunk. @pacopablo: I hope you don't mind.
Another thing that should be checked is whether the plugin would try to send e-mails even is no smtp settings are available in trac.ini. I fixed such an issue in another plugin long time ago, but can't remember what plugin it was. Will look into that again.
comment:9 Changed 14 years ago by
Keywords: | user account corrupt added |
---|---|
Resolution: | → fixed |
Status: | assigned → closed |
Summary: | Removing email from preferences makes account unusable → [patch] Removing email from preferences makes account unusable |
Replying to otaku42:
With the patch from manski the original issue should be fixed. I've committed the patch to 0.11 and trunk. @pacopablo: I hope you don't mind.
Good thing, so this ticket is solved. Thank you for the support.
Another thing that should be checked is whether the plugin would try to send e-mails even is no smtp settings are available in trac.ini. I fixed such an issue in another plugin long time ago, but can't remember what plugin it was. Will look into that again.
Certainly this is not as trivial as it sounds. In fact in addition to TracNotification there is AnnouncerPlugin, and both have smtp as well as sendmail transport capability plus enable/disable option to shutdown email even if configured, and maybe even more relevant stuff.
Feel free to open a new ticket, if you see issues related to this, since it's far beyond the scope of the original report here.
I've traced down the exception to lines 543-544 of web_ui.py. The issue seems arise from req.session['email'] being None there (see line 544) I've made following changed these lines to following:
Not a perfect fix, as this way it still keeps sending an e-mail every time you access a page until you eventually confirm new e-mail. But at least it lets you to confirm the e-mail and works ok after that.