mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-21 08:31:27 -05:00
rename
This commit is contained in:
parent
3d1586d9cb
commit
a133b6de31
1 changed files with 6 additions and 7 deletions
|
@ -391,22 +391,21 @@ func SettingsPost(ctx *context.Context) {
|
||||||
ctx.Flash.Info(ctx.Tr("repo.settings.federation_not_enabled"))
|
ctx.Flash.Info(ctx.Tr("repo.settings.federation_not_enabled"))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
// ToDo: Rename to followingRepos
|
followingRepos := strings.TrimSpace(form.FollowingRepos)
|
||||||
federationRepos := strings.TrimSpace(form.FederationRepos)
|
followingRepos = strings.TrimSuffix(followingRepos, ";")
|
||||||
federationRepos = strings.TrimSuffix(federationRepos, ";")
|
|
||||||
|
|
||||||
maxFollowingRepoStrLength := 2048
|
maxFollowingRepoStrLength := 2048
|
||||||
errs := validation.ValidateMaxLen(federationRepos, maxFollowingRepoStrLength, "federationRepos")
|
errs := validation.ValidateMaxLen(followingRepos, maxFollowingRepoStrLength, "federationRepos")
|
||||||
if len(errs) > 0 {
|
if len(errs) > 0 {
|
||||||
ctx.Data["ERR_FederationRepos"] = true
|
ctx.Data["ERR_FollowingRepos"] = true
|
||||||
ctx.Flash.Error(ctx.Tr("repo.form.string_too_long", maxFollowingRepoStrLength))
|
ctx.Flash.Error(ctx.Tr("repo.form.string_too_long", maxFollowingRepoStrLength))
|
||||||
ctx.Redirect(repo.Link() + "/settings")
|
ctx.Redirect(repo.Link() + "/settings")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
federationRepoSplit := []string{}
|
federationRepoSplit := []string{}
|
||||||
if federationRepos != "" {
|
if followingRepos != "" {
|
||||||
federationRepoSplit = strings.Split(federationRepos, ";")
|
federationRepoSplit = strings.Split(followingRepos, ";")
|
||||||
}
|
}
|
||||||
for idx, repo := range federationRepoSplit {
|
for idx, repo := range federationRepoSplit {
|
||||||
federationRepoSplit[idx] = strings.TrimSpace(repo)
|
federationRepoSplit[idx] = strings.TrimSpace(repo)
|
||||||
|
|
Loading…
Reference in a new issue