From 391921d8af04744da93264a1aa310926f14a686b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C4=93teris=20Caune?= Date: Sat, 12 Oct 2019 11:37:06 +0300 Subject: [PATCH] =?UTF-8?q?Revert=20deterministic=20username=20generation?= =?UTF-8?q?=20feature=20=E2=80=93=20it=20causes=20problems=20when=20users?= =?UTF-8?q?=20change=20their=20email=20address.=20See=20#290=20for=20detai?= =?UTF-8?q?ls.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 1 - hc/accounts/views.py | 7 +------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 17c4a94e..c10b2cca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,6 @@ All notable changes to this project will be documented in this file. - Add Go usage example ### Bug Fixes -- Usernames now are uuid3(const, email). Prevents multiple accts with same email (#290) - Prevent double-clicking the submit button in signup form - Upgrade to Django 2.2.6 – fixes sqlite migrations (#284) diff --git a/hc/accounts/views.py b/hc/accounts/views.py index 73352200..5c4e9a9b 100644 --- a/hc/accounts/views.py +++ b/hc/accounts/views.py @@ -43,8 +43,6 @@ NEXT_WHITELIST = ( "hc-add-pushover", ) -NAMESPACE_HC = uuid.UUID("2b25afdf-ce1a-4fa3-adf2-592e35f27fa9") - def _is_whitelisted(path): try: @@ -56,10 +54,7 @@ def _is_whitelisted(path): def _make_user(email, with_project=True): - # Generate username from email in a deterministic way. - # Since the database has an uniqueness constraint on username, - # this makes sure that emails also are unique. - username = str(uuid.uuid3(NAMESPACE_HC, email)) + username = str(uuid.uuid4())[:30] user = User(username=username, email=email) user.set_unusable_password() user.save()