Browse Source

Recovery email: strip leading/trailing whitespace

merge-requests/55/head
Deimos 6 years ago
parent
commit
8bce39c9be
  1. 3
      tildes/tildes/schemas/user.py

3
tildes/tildes/schemas/user.py

@ -114,6 +114,9 @@ class UserSchema(Schema):
if "email_address" not in data: if "email_address" not in data:
return data return data
# remove any leading/trailing whitespace
data["email_address"] = data["email_address"].strip()
# if the value is empty, convert it to None # if the value is empty, convert it to None
if not data["email_address"] or data["email_address"].isspace(): if not data["email_address"] or data["email_address"].isspace():
data["email_address"] = None data["email_address"] = None

Loading…
Cancel
Save