Ticket #3401 (closed defect: fixed)

Opened 4 years ago

Last modified 1 year ago

[patch] Removing email from preferences makes account unusable

Reported by: heikki Assigned to: pacopablo
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

patch (3.7 kB) - added by anonymous on 11/20/08 17:13:12.
empty_email.patch (1.4 kB) - added by manski on 05/28/09 09:36:00.
Patch against r5836 and Trac 0.11.4

Change History

07/17/08 06:33:36 changed by anonymous

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:

            useremail = req.session.get('email')
            if useremail is None:
                useremail = ''
            chrome.add_notice(req, MessageWrapper(tag.span(
                    'An email has been sent to ', useremail,

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.

11/20/08 17:10:48 changed by anonymous

I had the same problem. (Trac 0.11.2, TracAccountManager-0.2.1dev). My investigation lead to the attached patch.

11/20/08 17:13:12 changed by anonymous

  • attachment patch added.

11/27/08 12:55:41 changed by anonymous

You may want to take a look at #4125, there is another patch that tries to fix this part of code

01/30/09 21:13:50 changed by pacopablo

  • owner changed from mgood to pacopablo.
  • status changed from new to assigned.

05/28/09 09:36:00 changed by manski

  • attachment empty_email.patch added.

Patch against r5836 and Trac 0.11.4

05/28/09 09:37:43 changed by manski

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.

11/23/09 07:23:23 changed by otaku42

(In [7162]) Add patch from manski which prevents the e-mail address verification mail to be sent if the user has not set an e-mail address. Refs #3401

11/23/09 07:30:08 changed by otaku42

(In [7164]) Add patch from manski which prevents the e-mail address verification mail to be sent if the user has not set an e-mail address. Refs #3401

(follow-up: ↓ 9 ) 11/23/09 07:36:26 changed by 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.

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.

(in reply to: ↑ 8 ) 10/02/10 00:01:08 changed by hasienda

  • keywords set to user account corrupt.
  • status changed from assigned to closed.
  • resolution set to fixed.
  • summary changed from Removing email from preferences makes account unusable to [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.


Add/Change #3401 ([patch] Removing email from preferences makes account unusable)




Change Properties
Action