From cd5c84529ee3c52aebce0974b061c739d8dae477 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Fri, 25 Oct 2019 17:00:36 +0100 Subject: [PATCH] accounts: Do not fail when an account has already been created When people choose a password that is too weak, the account might already have been created and a second attempt will fail. This prevents that. Signed-off-by: Michael Tremer --- src/backend/accounts.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/backend/accounts.py b/src/backend/accounts.py index 9d72b1cb..d36dbafb 100644 --- a/src/backend/accounts.py +++ b/src/backend/accounts.py @@ -218,6 +218,11 @@ class Accounts(Object): if not res: return + # Return the account if it has already been created + account = self.get_by_uid(uid) + if account: + return account + # Create a new account on the LDAP database account = self.create(uid, res.email, first_name=res.first_name, last_name=res.last_name, -- 2.47.3