After a bit of deep cave diving into the code I suspect it’s this in 
model/usermanager.py

This function appears to create a user before it checks to see if the address 
exists, with the result that multiple users are created when the address 
already exists.

@implementer(IUserManager)
class UserManager:
    """See `IUserManager`."""

    def create_user(self, email=None, display_name=None):
        """See `IUserManager`."""
        user = User(display_name, Preferences())
        if email:
            address = self.create_address(email, display_name)
            user.link(address)
        return user


this seems to fix the problem - but please don’t trust my solution - needs 
verification.

@implementer(IUserManager)
class UserManager:
    """See `IUserManager`."""

    def create_user(self, email=None, display_name=None):
        """See `IUserManager`."""
        if email:
            address = self.create_address(email, display_name)
        user = User(display_name, Preferences())
        if email:
            user.link(address)
        return user


On 5 Feb 2015, at 7:59 am, Barry Warsaw <ba...@list.org> wrote:

On Feb 05, 2015, at 07:23 AM, Andrew Stuart wrote:

> To get the source I do:
> 
> bzr branch lp:mailman
> 
> Is this the correct way?
> 
> I’m using Python 3.4

Yep, exactly so.

Thanks.  I'll give it a go tonight.
-B

_______________________________________________
Mailman-Developers mailing list
Mailman-Developers@python.org
https://mail.python.org/mailman/listinfo/mailman-developers
Mailman FAQ: http://wiki.list.org/x/AgA3
Searchable Archives: 
http://www.mail-archive.com/mailman-developers%40python.org/
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-developers/archive%40jab.org

Security Policy: http://wiki.list.org/x/QIA9

Reply via email to