diff options
author | Unknwon <u@gogs.io> | 2015-11-22 01:32:09 -0500 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2015-11-22 01:32:09 -0500 |
commit | 52c8f691630548fe091d30bcfe8164545a05d3d5 (patch) | |
tree | 12ad797f4c2f8ae6ea81e59e4a0e73ec76abaef3 /routers/org | |
parent | b80e848d02b4e27e067910c03aadeddcbdd5f3f5 (diff) | |
download | gitea-52c8f691630548fe091d30bcfe8164545a05d3d5.tar.gz gitea-52c8f691630548fe091d30bcfe8164545a05d3d5.zip |
fix #650
Diffstat (limited to 'routers/org')
-rw-r--r-- | routers/org/members.go | 2 | ||||
-rw-r--r-- | routers/org/teams.go | 13 |
2 files changed, 9 insertions, 6 deletions
diff --git a/routers/org/members.go b/routers/org/members.go index dd742bb7a2..a0a3051d4e 100644 --- a/routers/org/members.go +++ b/routers/org/members.go @@ -50,7 +50,7 @@ func MembersAction(ctx *middleware.Context) { } err = models.ChangeOrgUserStatus(org.Id, uid, false) case "public": - if ctx.User.Id != uid { + if ctx.User.Id != uid && !ctx.Org.IsOwner { ctx.Error(404) return } diff --git a/routers/org/teams.go b/routers/org/teams.go index 6968512fed..2dd3c1981c 100644 --- a/routers/org/teams.go +++ b/routers/org/teams.go @@ -120,7 +120,7 @@ func TeamsRepoAction(ctx *middleware.Context) { var err error switch ctx.Params(":action") { case "add": - repoName := path.Base(ctx.Query("repo-name")) + repoName := path.Base(ctx.Query("repo_name")) var repo *models.Repository repo, err = models.GetRepositoryByName(ctx.Org.Organization.Id, repoName) if err != nil { @@ -280,9 +280,12 @@ func EditTeamPost(ctx *middleware.Context, form auth.CreateTeamForm) { func DeleteTeam(ctx *middleware.Context) { if err := models.DeleteTeam(ctx.Org.Team); err != nil { - ctx.Handle(500, "DeleteTeam", err) - return + ctx.Flash.Error("DeleteTeam: " + err.Error()) + } else { + ctx.Flash.Success(ctx.Tr("org.teams.delete_team_success")) } - ctx.Flash.Success(ctx.Tr("org.teams.delete_team_success")) - ctx.Redirect(ctx.Org.OrgLink + "/teams") + + ctx.JSON(200, map[string]interface{}{ + "redirect": ctx.Org.OrgLink + "/teams", + }) } |