Skip to content

Commit 49c0a7b

Browse files
committed
Fix: lower case the email
1 parent 64ca18b commit 49c0a7b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ckanext/oauth2/oauth2.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,15 +245,15 @@ def user_json(self, user_data):
245245
# Some providers, like Google and FIWARE only allows one account per email
246246
user = None
247247
if email:
248-
existing_user = model.User.by_email(email)
248+
existing_user = model.User.by_email(email.lower())
249249
if existing_user:
250250
existing_user.state = (
251251
"active" if existing_user.state == "active" else existing_user.state
252252
)
253253
user = existing_user
254254
else:
255255
user = model.User()
256-
user.email = email
256+
user.email = email.lower()
257257
name = email.partition("@")[0]
258258
name = re.sub(r"\W", "_", name)
259259
is_name_available = model.User.check_name_available(name)

0 commit comments

Comments
 (0)