Skip to content
Snippets Groups Projects
Verified Commit e9599bbb authored by nd's avatar nd
Browse files

set user mail adress to verified if it matches the one in ldap

parent f094ee66
Branches
Tags
1 merge request!1set user mail adress to verified if it matches the one in ldap
......@@ -10,6 +10,7 @@ from urllib.error import HTTPError
from postorius.models import List, MailmanUser
from postorius.utils import get_mailman_client
from allauth.account.models import EmailAddress
logger = logging.getLogger(__name__)
......@@ -44,6 +45,13 @@ class Command(BaseCommand):
logger.warning("update display_name on {} to {}".format(user.username, user.get_full_name()))
mm_users[user.username].display_name = user.get_full_name()
mm_users[user.username].save()
# set user mail adresses to verified if they match those in ldap
user_emails = EmailAddress.objects.filter(user=user)
for mail in user_emails:
if mail.email == user.email:
mail.verified = True
mail.save()
mailman_id2username = {mm_users[i].user_id: i for i in mm_users}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment