summaryrefslogtreecommitdiffstats
path: root/models/user.go
diff options
context:
space:
mode:
Diffstat (limited to 'models/user.go')
-rw-r--r--models/user.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/models/user.go b/models/user.go
index 8056e30cea..4597508fb1 100644
--- a/models/user.go
+++ b/models/user.go
@@ -1559,8 +1559,8 @@ func GetUserByEmailContext(ctx DBContext, email string) (*User, error) {
// Finally, if email address is the protected email address:
if strings.HasSuffix(email, fmt.Sprintf("@%s", setting.Service.NoReplyAddress)) {
username := strings.TrimSuffix(email, fmt.Sprintf("@%s", setting.Service.NoReplyAddress))
- user := &User{LowerName: username}
- has, err := ctx.e.Get(user)
+ user := &User{}
+ has, err := ctx.e.Where("lower_name=?", username).Get(user)
if err != nil {
return nil, err
}