summaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2022-05-20 22:08:52 +0800
committerGitHub <noreply@github.com>2022-05-20 22:08:52 +0800
commitfd7d83ace60258acf7139c4c787aa8af75b7ba8c (patch)
tree50038348ec10485f72344f3ac80324e04abc1283 /cmd
parentd81e31ad7826a81fc7139f329f250594610a274b (diff)
downloadgitea-fd7d83ace60258acf7139c4c787aa8af75b7ba8c.tar.gz
gitea-fd7d83ace60258acf7139c4c787aa8af75b7ba8c.zip
Move almost all functions' parameter db.Engine to context.Context (#19748)
* Move almost all functions' parameter db.Engine to context.Context * remove some unnecessary wrap functions
Diffstat (limited to 'cmd')
-rw-r--r--cmd/admin.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/cmd/admin.go b/cmd/admin.go
index fcf331751c..0629dfc2db 100644
--- a/cmd/admin.go
+++ b/cmd/admin.go
@@ -490,7 +490,7 @@ func runChangePassword(c *cli.Context) error {
return errors.New("The password you chose is on a list of stolen passwords previously exposed in public data breaches. Please try again with a different password.\nFor more details, see https://haveibeenpwned.com/Passwords")
}
uname := c.String("username")
- user, err := user_model.GetUserByName(uname)
+ user, err := user_model.GetUserByName(ctx, uname)
if err != nil {
return err
}
@@ -659,7 +659,7 @@ func runDeleteUser(c *cli.Context) error {
if c.IsSet("email") {
user, err = user_model.GetUserByEmail(c.String("email"))
} else if c.IsSet("username") {
- user, err = user_model.GetUserByName(c.String("username"))
+ user, err = user_model.GetUserByName(ctx, c.String("username"))
} else {
user, err = user_model.GetUserByID(c.Int64("id"))
}
@@ -689,7 +689,7 @@ func runGenerateAccessToken(c *cli.Context) error {
return err
}
- user, err := user_model.GetUserByName(c.String("username"))
+ user, err := user_model.GetUserByName(ctx, c.String("username"))
if err != nil {
return err
}