Browse Source

Revert deterministic username generation feature – it causes problems when users change their email address. See #290 for details.

pull/307/head
Pēteris Caune 5 years ago
parent
commit
391921d8af
No known key found for this signature in database GPG Key ID: E28D7679E9A9EDE2
2 changed files with 1 additions and 7 deletions
  1. +0
    -1
      CHANGELOG.md
  2. +1
    -6
      hc/accounts/views.py

+ 0
- 1
CHANGELOG.md View File

@ -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)


+ 1
- 6
hc/accounts/views.py View File

@ -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()


Loading…
Cancel
Save