|
|
|
@@ -13,6 +13,8 @@ import ( |
|
|
|
"strconv" |
|
|
|
) |
|
|
|
|
|
|
|
const DefaultOrgTagLimit = -1 |
|
|
|
|
|
|
|
// SubmitTags submit repos of org tag |
|
|
|
func SubmitTags(ctx *context.Context, form auth.SubmitReposOfTagForm) { |
|
|
|
if !ctx.Org.IsOwner { |
|
|
|
@@ -23,6 +25,10 @@ func SubmitTags(ctx *context.Context, form auth.SubmitReposOfTagForm) { |
|
|
|
if ctx.Written() { |
|
|
|
return |
|
|
|
} |
|
|
|
if tag.Limit != DefaultOrgTagLimit && len(form.RepoList) > tag.Limit { |
|
|
|
ctx.ServerError("UpdateTagReposByID", errors.New("tags size over limit")) |
|
|
|
return |
|
|
|
} |
|
|
|
err := models.UpdateTagReposByID(tag.ID, ctx.Org.Organization.ID, form.RepoList) |
|
|
|
if err != nil { |
|
|
|
ctx.ServerError("UpdateTagReposByID", err) |
|
|
|
|