From 59e17c87af6b5c4e562ed8a5c3de88946c93b0b8 Mon Sep 17 00:00:00 2001 From: Erfan <143827987+erfjab@users.noreply.github.com> Date: Fri, 25 Oct 2024 18:07:41 +0330 Subject: [PATCH] Fix: username hash --- import/utils/helpers.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/import/utils/helpers.py b/import/utils/helpers.py index 4d6554c..edd34ae 100644 --- a/import/utils/helpers.py +++ b/import/utils/helpers.py @@ -84,9 +84,9 @@ def parse_marz_user(old: MarzUserData, service: int) -> UserCreate: else None ) - username = (old.username).lower() - clean = re.sub(r"[^\w]", "", username) - hash_part = hashlib.md5(username.encode()).hexdigest()[:4] + username = old.username + clean = re.sub(r"[^\w]", "", (username).lower()) + hash_part = hashlib.md5(username.encode()).hexdigest()[:8] username = f"{clean}_{hash_part}"[:32] return UserCreate(