summaryrefslogtreecommitdiffstats
path: root/models/user
diff options
context:
space:
mode:
authorNanguan Lin <nanguanlin6@gmail.com>2024-03-17 21:24:45 +0800
committerGitHub <noreply@github.com>2024-03-17 13:24:45 +0000
commitdf05c558da704f0c9c9f11d32bba2a9c1cb2f8a8 (patch)
treec082bdc83028444cae66c2bfacf329e4d16cc86d /models/user
parent33973ac567d6681bda26d82f26b7294a297c693f (diff)
downloadgitea-df05c558da704f0c9c9f11d32bba2a9c1cb2f8a8.tar.gz
gitea-df05c558da704f0c9c9f11d32bba2a9c1cb2f8a8.zip
Fix user id column case (#29863)
Sometimes the column name is case-sensitive and it may cause 500.
Diffstat (limited to 'models/user')
-rw-r--r--models/user/email_address.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/models/user/email_address.go b/models/user/email_address.go
index a9dbb8e891..d26549f383 100644
--- a/models/user/email_address.go
+++ b/models/user/email_address.go
@@ -434,7 +434,7 @@ func SearchEmails(ctx context.Context, opts *SearchEmailOptions) ([]*SearchEmail
cond = cond.And(builder.Eq{"email_address.is_activated": opts.IsActivated.Value()})
}
- count, err := db.GetEngine(ctx).Join("INNER", "`user`", "`user`.ID = email_address.uid").
+ count, err := db.GetEngine(ctx).Join("INNER", "`user`", "`user`.id = email_address.uid").
Where(cond).Count(new(EmailAddress))
if err != nil {
return nil, 0, fmt.Errorf("Count: %w", err)
@@ -450,7 +450,7 @@ func SearchEmails(ctx context.Context, opts *SearchEmailOptions) ([]*SearchEmail
emails := make([]*SearchEmailResult, 0, opts.PageSize)
err = db.GetEngine(ctx).Table("email_address").
Select("email_address.*, `user`.name, `user`.full_name").
- Join("INNER", "`user`", "`user`.ID = email_address.uid").
+ Join("INNER", "`user`", "`user`.id = email_address.uid").
Where(cond).
OrderBy(orderby).
Limit(opts.PageSize, (opts.Page-1)*opts.PageSize).