mirror of
https://github.com/go-gitea/gitea
synced 2025-12-07 13:28:25 +00:00
Change code for adding all repositories
Signed-off-by: David Svantesson <davidsvantesson@gmail.com>
This commit is contained in:
@@ -198,7 +198,7 @@ func EditTeam(ctx *context.APIContext, form api.EditTeamOption) {
|
||||
team.Units = units
|
||||
}
|
||||
|
||||
if err := models.UpdateTeam(team, true); err != nil {
|
||||
if err := models.UpdateTeam(team, true, true); err != nil {
|
||||
ctx.Error(500, "EditTeam", err)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -270,6 +270,7 @@ func EditTeamPost(ctx *context.Context, form auth.CreateTeamForm) {
|
||||
ctx.Data["Units"] = models.Units
|
||||
|
||||
isAuthChanged := false
|
||||
isIncludeAllChanged := false
|
||||
if !t.IsOwnerTeam() {
|
||||
// Validate permission level.
|
||||
auth := models.ParseAccessMode(form.Permission)
|
||||
@@ -280,7 +281,10 @@ func EditTeamPost(ctx *context.Context, form auth.CreateTeamForm) {
|
||||
t.Authorize = auth
|
||||
}
|
||||
|
||||
t.IncludesAllRepositories = form.IncludesAllRepositories
|
||||
if t.IncludesAllRepositories != form.IncludesAllRepositories {
|
||||
isIncludeAllChanged = true
|
||||
t.IncludesAllRepositories = form.IncludesAllRepositories
|
||||
}
|
||||
}
|
||||
t.Description = form.Description
|
||||
if t.Authorize < models.AccessModeOwner {
|
||||
@@ -309,7 +313,7 @@ func EditTeamPost(ctx *context.Context, form auth.CreateTeamForm) {
|
||||
return
|
||||
}
|
||||
|
||||
if err := models.UpdateTeam(t, isAuthChanged); err != nil {
|
||||
if err := models.UpdateTeam(t, isAuthChanged, isIncludeAllChanged); err != nil {
|
||||
ctx.Data["Err_TeamName"] = true
|
||||
switch {
|
||||
case models.IsErrTeamAlreadyExist(err):
|
||||
|
||||
Reference in New Issue
Block a user