summaryrefslogtreecommitdiffstats
path: root/routers/repo/repo.go
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2016-07-24 01:08:22 +0800
committerUnknwon <u@gogs.io>2016-07-24 01:08:22 +0800
commit1f2e173a745da8e4b57f96b5561a3c10054d3b76 (patch)
tree367f0f07e4fe1269ac0772e0561a4bf912b5153c /routers/repo/repo.go
parent46e96c008cf966428c9dad71c7871de88186e3fe (diff)
downloadgitea-1f2e173a745da8e4b57f96b5561a3c10054d3b76.tar.gz
gitea-1f2e173a745da8e4b57f96b5561a3c10054d3b76.zip
Refactor User.Id to User.ID
Diffstat (limited to 'routers/repo/repo.go')
-rw-r--r--routers/repo/repo.go18
1 files changed, 9 insertions, 9 deletions
diff --git a/routers/repo/repo.go b/routers/repo/repo.go
index f9835bd2f9..3c1775dce4 100644
--- a/routers/repo/repo.go
+++ b/routers/repo/repo.go
@@ -34,7 +34,7 @@ func MustBeNotBare(ctx *context.Context) {
}
func checkContextUser(ctx *context.Context, uid int64) *models.User {
- orgs, err := models.GetOwnedOrgsByUserIDDesc(ctx.User.Id, "updated_unix")
+ orgs, err := models.GetOwnedOrgsByUserIDDesc(ctx.User.ID, "updated_unix")
if err != nil {
ctx.Handle(500, "GetOwnedOrgsByUserIDDesc", err)
return nil
@@ -42,7 +42,7 @@ func checkContextUser(ctx *context.Context, uid int64) *models.User {
ctx.Data["Orgs"] = orgs
// Not equal means current user is an organization.
- if uid == ctx.User.Id || uid == 0 {
+ if uid == ctx.User.ID || uid == 0 {
return ctx.User
}
@@ -57,7 +57,7 @@ func checkContextUser(ctx *context.Context, uid int64) *models.User {
}
// Check ownership of organization.
- if !org.IsOrganization() || !(ctx.User.IsAdmin || org.IsOwnedBy(ctx.User.Id)) {
+ if !org.IsOrganization() || !(ctx.User.IsAdmin || org.IsOwnedBy(ctx.User.ID)) {
ctx.Error(403)
return nil
}
@@ -136,7 +136,7 @@ func CreatePost(ctx *context.Context, form auth.CreateRepoForm) {
}
if repo != nil {
- if errDelete := models.DeleteRepository(ctxUser.Id, repo.ID); errDelete != nil {
+ if errDelete := models.DeleteRepository(ctxUser.ID, repo.ID); errDelete != nil {
log.Error(4, "DeleteRepository: %v", errDelete)
}
}
@@ -208,7 +208,7 @@ func MigratePost(ctx *context.Context, form auth.MigrateRepoForm) {
}
if repo != nil {
- if errDelete := models.DeleteRepository(ctxUser.Id, repo.ID); errDelete != nil {
+ if errDelete := models.DeleteRepository(ctxUser.ID, repo.ID); errDelete != nil {
log.Error(4, "DeleteRepository: %v", errDelete)
}
}
@@ -231,13 +231,13 @@ func Action(ctx *context.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": // FIXME: this is not used
if !ctx.Repo.IsOwner() {
ctx.Error(404)