Set the user name on creation to the original email (#1462)

Co-authored-by: Adrià Casajús <adria.casajus@proton.ch>
This commit is contained in:
Adrià Casajús 2022-12-01 13:07:36 +01:00 committed by GitHub
parent 12b18dd8b1
commit 327b672f24
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View file

@ -91,7 +91,8 @@ def auth_register():
if not data:
return jsonify(error="request body cannot be empty"), 400
email = canonicalize_email(data.get("email"))
dirty_email = data.get("email")
email = canonicalize_email(dirty_email)
password = data.get("password")
if DISABLE_REGISTRATION:
@ -112,7 +113,7 @@ def auth_register():
return jsonify(error="password too long"), 400
LOG.d("create user %s", email)
user = User.create(email=email, name="", password=password)
user = User.create(email=email, name=dirty_email, password=password)
Session.flush()
# create activation code

View file

@ -85,7 +85,7 @@ def register():
LOG.d("create user %s", email)
user = User.create(
email=email,
name="",
name=form.email.data,
password=form.password.data,
referral=get_referral(),
)