summaryrefslogtreecommitdiffstats
path: root/routers/api/v1/admin
diff options
context:
space:
mode:
Diffstat (limited to 'routers/api/v1/admin')
-rw-r--r--routers/api/v1/admin/adopt.go8
-rw-r--r--routers/api/v1/admin/user.go2
2 files changed, 5 insertions, 5 deletions
diff --git a/routers/api/v1/admin/adopt.go b/routers/api/v1/admin/adopt.go
index 3c39d7c2bc..8f11ab67f0 100644
--- a/routers/api/v1/admin/adopt.go
+++ b/routers/api/v1/admin/adopt.go
@@ -85,7 +85,7 @@ func AdoptRepository(ctx *context.APIContext) {
ownerName := ctx.Params(":username")
repoName := ctx.Params(":reponame")
- ctxUser, err := user_model.GetUserByName(ownerName)
+ ctxUser, err := user_model.GetUserByName(ctx, ownerName)
if err != nil {
if user_model.IsErrUserNotExist(err) {
ctx.NotFound()
@@ -96,7 +96,7 @@ func AdoptRepository(ctx *context.APIContext) {
}
// check not a repo
- has, err := repo_model.IsRepositoryExist(ctxUser, repoName)
+ has, err := repo_model.IsRepositoryExist(ctx, ctxUser, repoName)
if err != nil {
ctx.InternalServerError(err)
return
@@ -147,7 +147,7 @@ func DeleteUnadoptedRepository(ctx *context.APIContext) {
ownerName := ctx.Params(":username")
repoName := ctx.Params(":reponame")
- ctxUser, err := user_model.GetUserByName(ownerName)
+ ctxUser, err := user_model.GetUserByName(ctx, ownerName)
if err != nil {
if user_model.IsErrUserNotExist(err) {
ctx.NotFound()
@@ -158,7 +158,7 @@ func DeleteUnadoptedRepository(ctx *context.APIContext) {
}
// check not a repo
- has, err := repo_model.IsRepositoryExist(ctxUser, repoName)
+ has, err := repo_model.IsRepositoryExist(ctx, ctxUser, repoName)
if err != nil {
ctx.InternalServerError(err)
return
diff --git a/routers/api/v1/admin/user.go b/routers/api/v1/admin/user.go
index 6263a67048..71932136b1 100644
--- a/routers/api/v1/admin/user.go
+++ b/routers/api/v1/admin/user.go
@@ -269,7 +269,7 @@ func EditUser(ctx *context.APIContext) {
ctx.ContextUser.IsRestricted = *form.Restricted
}
- if err := user_model.UpdateUser(ctx.ContextUser, emailChanged); err != nil {
+ if err := user_model.UpdateUser(ctx, ctx.ContextUser, emailChanged); err != nil {
if user_model.IsErrEmailAlreadyUsed(err) ||
user_model.IsErrEmailCharIsNotSupported(err) ||
user_model.IsErrEmailInvalid(err) {