Ticket #13374 (confirmed Bug)
registeredNotify sending out duplicate emails on ConflictErrors
Reported by: | oolitegroove@… | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | 4.x |
Component: | General | Version: | 4.1 |
Keywords: | registration, ConflictError | Cc: |
Description
We had a user report that they received duplicate registration emails when their account was created on a portal. A review of the code shows handle_join_success (plone.app.users.browser.register) catching all errors in order to display a more user friendly message, and in doing so correctly makes an exception for ConflictError which it re-raises. However, registeredNotify (Products.CMFPlone.RegistrationTool) ends up sending out another email since a database rollback obviously won't affect emails. A look at the zope logs reveals that we did get a ConflictError at the same time here.
Shouldn't registeredNotify have a transaction.commit() line just before it actually has the MailHost send an email?
Plone 4.1.3, but it looks like the code is the same in the newest version in github.