summaryrefslogtreecommitdiffstats
path: root/routers/org/teams.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/org/teams.go')
-rw-r--r--routers/org/teams.go28
1 files changed, 14 insertions, 14 deletions
diff --git a/routers/org/teams.go b/routers/org/teams.go
index cfa49d4e97..ad2c869eb6 100644
--- a/routers/org/teams.go
+++ b/routers/org/teams.go
@@ -44,7 +44,7 @@ func Teams(ctx *context.Context) {
}
ctx.Data["Teams"] = org.Teams
- ctx.HTML(200, tplTeams)
+ ctx.HTML(http.StatusOK, tplTeams)
}
// TeamsAction response for join, leave, remove, add operations to team
@@ -60,7 +60,7 @@ func TeamsAction(ctx *context.Context) {
switch ctx.Params(":action") {
case "join":
if !ctx.Org.IsOwner {
- ctx.Error(404)
+ ctx.Error(http.StatusNotFound)
return
}
err = ctx.Org.Team.AddMember(ctx.User.ID)
@@ -68,14 +68,14 @@ func TeamsAction(ctx *context.Context) {
err = ctx.Org.Team.RemoveMember(ctx.User.ID)
case "remove":
if !ctx.Org.IsOwner {
- ctx.Error(404)
+ ctx.Error(http.StatusNotFound)
return
}
err = ctx.Org.Team.RemoveMember(uid)
page = "team"
case "add":
if !ctx.Org.IsOwner {
- ctx.Error(404)
+ ctx.Error(http.StatusNotFound)
return
}
uname := utils.RemoveUsernameParameterSuffix(strings.ToLower(ctx.Query("uname")))
@@ -111,7 +111,7 @@ func TeamsAction(ctx *context.Context) {
ctx.Flash.Error(ctx.Tr("form.last_org_owner"))
} else {
log.Error("Action(%s): %v", ctx.Params(":action"), err)
- ctx.JSON(200, map[string]interface{}{
+ ctx.JSON(http.StatusOK, map[string]interface{}{
"ok": false,
"err": err.Error(),
})
@@ -132,7 +132,7 @@ func TeamsAction(ctx *context.Context) {
// TeamsRepoAction operate team's repository
func TeamsRepoAction(ctx *context.Context) {
if !ctx.Org.IsOwner {
- ctx.Error(404)
+ ctx.Error(http.StatusNotFound)
return
}
@@ -168,7 +168,7 @@ func TeamsRepoAction(ctx *context.Context) {
}
if action == "addall" || action == "removeall" {
- ctx.JSON(200, map[string]interface{}{
+ ctx.JSON(http.StatusOK, map[string]interface{}{
"redirect": ctx.Org.OrgLink + "/teams/" + ctx.Org.Team.LowerName + "/repositories",
})
return
@@ -183,7 +183,7 @@ func NewTeam(ctx *context.Context) {
ctx.Data["PageIsOrgTeamsNew"] = true
ctx.Data["Team"] = &models.Team{}
ctx.Data["Units"] = models.Units
- ctx.HTML(200, tplTeamNew)
+ ctx.HTML(http.StatusOK, tplTeamNew)
}
// NewTeamPost response for create new team
@@ -218,7 +218,7 @@ func NewTeamPost(ctx *context.Context) {
ctx.Data["Team"] = t
if ctx.HasError() {
- ctx.HTML(200, tplTeamNew)
+ ctx.HTML(http.StatusOK, tplTeamNew)
return
}
@@ -250,7 +250,7 @@ func TeamMembers(ctx *context.Context) {
ctx.ServerError("GetMembers", err)
return
}
- ctx.HTML(200, tplTeamMembers)
+ ctx.HTML(http.StatusOK, tplTeamMembers)
}
// TeamRepositories show the repositories of team
@@ -262,7 +262,7 @@ func TeamRepositories(ctx *context.Context) {
ctx.ServerError("GetRepositories", err)
return
}
- ctx.HTML(200, tplTeamRepositories)
+ ctx.HTML(http.StatusOK, tplTeamRepositories)
}
// EditTeam render team edit page
@@ -272,7 +272,7 @@ func EditTeam(ctx *context.Context) {
ctx.Data["team_name"] = ctx.Org.Team.Name
ctx.Data["desc"] = ctx.Org.Team.Description
ctx.Data["Units"] = models.Units
- ctx.HTML(200, tplTeamNew)
+ ctx.HTML(http.StatusOK, tplTeamNew)
}
// EditTeamPost response for modify team information
@@ -321,7 +321,7 @@ func EditTeamPost(ctx *context.Context) {
t.CanCreateOrgRepo = form.CanCreateOrgRepo
if ctx.HasError() {
- ctx.HTML(200, tplTeamNew)
+ ctx.HTML(http.StatusOK, tplTeamNew)
return
}
@@ -351,7 +351,7 @@ func DeleteTeam(ctx *context.Context) {
ctx.Flash.Success(ctx.Tr("org.teams.delete_team_success"))
}
- ctx.JSON(200, map[string]interface{}{
+ ctx.JSON(http.StatusOK, map[string]interface{}{
"redirect": ctx.Org.OrgLink + "/teams",
})
}