From ca6bddf4a624d34562b3c8d79860f9806bc7ee62 Mon Sep 17 00:00:00 2001
From: Florent Gluck <florent.gluck@hesge.ch>
Date: Fri, 7 Oct 2022 14:11:22 +0200
Subject: [PATCH] Proposition of a new strategy to guess the login AAI from the
 email

---
 pwm | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/pwm b/pwm
index 04e786b..c9a87c7 100755
--- a/pwm
+++ b/pwm
@@ -64,6 +64,11 @@ def emails_to_ids(emails: List[str], headers: Dict[str, str]) -> List[int]:
         # Dirty and hackish way that attempts to extract the username from the email.
         # It's inefficient, but currently there is now way to reliably obtain
         # the username from the email.
+        # TODO: new strategy:
+        # - stop when we reach the "." or when we get more than 1 result
+        # Example of tricky users:
+        # pierre-louis.roden@etu.hesge.ch -> login AAI: pierrelo.roden
+        # joel.ferreirapinto@etu.hesge.ch -> login AAI: joelfili.ferreira
         username = email.split("@")[0]
         #print("Email: ",email)
 
-- 
GitLab