aboutsummaryrefslogtreecommitdiff
path: root/routers/repo/repo.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/repo/repo.go')
-rw-r--r--routers/repo/repo.go16
1 files changed, 8 insertions, 8 deletions
diff --git a/routers/repo/repo.go b/routers/repo/repo.go
index dde8b584..7bc2f764 100644
--- a/routers/repo/repo.go
+++ b/routers/repo/repo.go
@@ -33,7 +33,7 @@ func checkContextUser(ctx *middleware.Context, uid int64) *models.User {
return ctx.User
}
- org, err := models.GetUserById(uid)
+ org, err := models.GetUserByID(uid)
if models.IsErrUserNotExist(err) {
return ctx.User
}
@@ -112,7 +112,7 @@ func CreatePost(ctx *middleware.Context, form auth.CreateRepoForm) {
}
if repo != nil {
- if errDelete := models.DeleteRepository(ctxUser.Id, repo.Id, ctxUser.Name); errDelete != nil {
+ if errDelete := models.DeleteRepository(ctxUser.Id, repo.ID, ctxUser.Name); errDelete != nil {
log.Error(4, "DeleteRepository: %v", errDelete)
}
}
@@ -209,14 +209,14 @@ func MigratePost(ctx *middleware.Context, form auth.MigrateRepoForm) {
}
if repo != nil {
- if errDelete := models.DeleteRepository(ctxUser.Id, repo.Id, ctxUser.Name); errDelete != nil {
+ if errDelete := models.DeleteRepository(ctxUser.Id, repo.ID, ctxUser.Name); errDelete != nil {
log.Error(4, "DeleteRepository: %v", errDelete)
}
}
if strings.Contains(err.Error(), "Authentication failed") {
ctx.Data["Err_Auth"] = true
- ctx.RenderWithErr(ctx.Tr("form.auth_failed", err), MIGRATE, &form)
+ ctx.RenderWithErr(ctx.Tr("form.auth_failed", strings.Replace(err.Error(), ":"+form.AuthPassword+"@", ":<password>@", 1)), MIGRATE, &form)
return
}
@@ -239,13 +239,13 @@ func Action(ctx *middleware.Context) {
var err error
switch ctx.Params(":action") {
case "watch":
- err = models.WatchRepo(ctx.User.Id, ctx.Repo.Repository.Id, true)
+ err = models.WatchRepo(ctx.User.Id, ctx.Repo.Repository.ID, true)
case "unwatch":
- err = models.WatchRepo(ctx.User.Id, ctx.Repo.Repository.Id, false)
+ err = models.WatchRepo(ctx.User.Id, ctx.Repo.Repository.ID, false)
case "star":
- err = models.StarRepo(ctx.User.Id, ctx.Repo.Repository.Id, true)
+ err = models.StarRepo(ctx.User.Id, ctx.Repo.Repository.ID, true)
case "unstar":
- err = models.StarRepo(ctx.User.Id, ctx.Repo.Repository.Id, false)
+ err = models.StarRepo(ctx.User.Id, ctx.Repo.Repository.ID, false)
case "desc":
if !ctx.Repo.IsOwner() {
ctx.Error(404)