From c52bdd0daf66047e41f56db4967819162861dd46 Mon Sep 17 00:00:00 2001 From: Ronan Date: Thu, 31 Aug 2023 16:28:06 +1000 Subject: [PATCH] Fix case sensitivity for duplicate email creation --- powerdnsadmin/models/user.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/powerdnsadmin/models/user.py b/powerdnsadmin/models/user.py index f1673a5..5a24c91 100644 --- a/powerdnsadmin/models/user.py +++ b/powerdnsadmin/models/user.py @@ -413,7 +413,7 @@ class User(db.Model): return {'status': False, 'msg': 'Username is already in use'} # check if email existed - user = User.query.filter(User.email == self.email).first() + user = User.query.filter(User.email.lower() == self.email.lower()).first() if user: return {'status': False, 'msg': 'Email address is already in use'}