File tree Expand file tree Collapse file tree 3 files changed +2
-7
lines changed Expand file tree Collapse file tree 3 files changed +2
-7
lines changed Original file line number Diff line number Diff line change @@ -39,10 +39,6 @@ func (vt VisibleType) IsPrivate() bool {
3939 return vt == VisibleTypePrivate
4040}
4141
42- func (vt VisibleType ) IsValid () bool {
43- return vt .String () != ""
44- }
45-
4642// VisibilityString provides the mode string of the visibility type (public, limited, private)
4743func (vt VisibleType ) String () string {
4844 for k , v := range VisibilityModes {
Original file line number Diff line number Diff line change @@ -2844,7 +2844,6 @@ settings.permission = Permissions
28442844settings.repoadminchangeteam = Repository admin can add and remove access for teams
28452845settings.visibility = Visibility
28462846settings.change_visibility = Change Visibility
2847- settings.invalid_visibility = The new visibility is not valid.
28482847settings.change_visibility_notices_1 = If the organization is converted to private, the repository stars will be removed and cannot be restored.
28492848settings.change_visibility_notices_2 = Non-members will lose access to the organization’s repositories if visibility is changed to private.
28502849settings.change_visibility_success = The visibility of organization %s has been successfully changed.
Original file line number Diff line number Diff line change @@ -233,8 +233,8 @@ func SettingsRenamePost(ctx *context.Context) {
233233
234234// SettingsChangeVisibilityPost response for change organization visibility
235235func SettingsChangeVisibilityPost (ctx * context.Context ) {
236- visibility := structs .VisibilityModes [ctx .FormString ("visibility" )]
237- if ! visibility . IsValid () {
236+ visibility , ok := structs .VisibilityModes [ctx .FormString ("visibility" )]
237+ if ! ok {
238238 ctx .Flash .Error (ctx .Tr ("invalid_data" , visibility ))
239239 ctx .JSONRedirect (setting .AppSubURL + "/org/" + url .PathEscape (ctx .Org .Organization .Name ) + "/settings" )
240240 return
You can’t perform that action at this time.
0 commit comments