improvements

This commit is contained in:
Lunny Xiao 2025-07-23 10:11:16 -07:00
parent 05e5d6c568
commit d1f1cf8a29
No known key found for this signature in database
GPG Key ID: C3B7C91B632F738A
3 changed files with 2 additions and 7 deletions

View File

@ -39,10 +39,6 @@ func (vt VisibleType) IsPrivate() bool {
return vt == VisibleTypePrivate
}
func (vt VisibleType) IsValid() bool {
return vt.String() != ""
}
// VisibilityString provides the mode string of the visibility type (public, limited, private)
func (vt VisibleType) String() string {
for k, v := range VisibilityModes {

View File

@ -2844,7 +2844,6 @@ settings.permission = Permissions
settings.repoadminchangeteam = Repository admin can add and remove access for teams
settings.visibility = Visibility
settings.change_visibility = Change Visibility
settings.invalid_visibility = The new visibility is not valid.
settings.change_visibility_notices_1 = If the organization is converted to private, the repository stars will be removed and cannot be restored.
settings.change_visibility_notices_2 = Non-members will lose access to the organizations repositories if visibility is changed to private.
settings.change_visibility_success = The visibility of organization %s has been successfully changed.

View File

@ -233,8 +233,8 @@ func SettingsRenamePost(ctx *context.Context) {
// SettingsChangeVisibilityPost response for change organization visibility
func SettingsChangeVisibilityPost(ctx *context.Context) {
visibility := structs.VisibilityModes[ctx.FormString("visibility")]
if !visibility.IsValid() {
visibility, ok := structs.VisibilityModes[ctx.FormString("visibility")]
if !ok {
ctx.Flash.Error(ctx.Tr("invalid_data", visibility))
ctx.JSONRedirect(setting.AppSubURL + "/org/" + url.PathEscape(ctx.Org.Organization.Name) + "/settings")
return