From 8bce39c9be26033b95aea588138e8c42b8d4fc52 Mon Sep 17 00:00:00 2001 From: Deimos Date: Sun, 10 Feb 2019 14:26:29 -0700 Subject: [PATCH] Recovery email: strip leading/trailing whitespace --- tildes/tildes/schemas/user.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tildes/tildes/schemas/user.py b/tildes/tildes/schemas/user.py index e6f99f5..5adc2d0 100644 --- a/tildes/tildes/schemas/user.py +++ b/tildes/tildes/schemas/user.py @@ -114,6 +114,9 @@ class UserSchema(Schema): if "email_address" not in 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 not data["email_address"] or data["email_address"].isspace(): data["email_address"] = None