Skip to content

Commit

Permalink
Fix: username hash
Browse files Browse the repository at this point in the history
  • Loading branch information
erfjab authored Oct 25, 2024
1 parent e5dd1b7 commit 59e17c8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions import/utils/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 59e17c8

Please sign in to comment.