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 {
39
39
return vt == VisibleTypePrivate
40
40
}
41
41
42
- func (vt VisibleType ) IsValid () bool {
43
- return vt .String () != ""
44
- }
45
-
46
42
// VisibilityString provides the mode string of the visibility type (public, limited, private)
47
43
func (vt VisibleType ) String () string {
48
44
for k , v := range VisibilityModes {
Original file line number Diff line number Diff line change @@ -2844,7 +2844,6 @@ settings.permission = Permissions
2844
2844
settings.repoadminchangeteam = Repository admin can add and remove access for teams
2845
2845
settings.visibility = Visibility
2846
2846
settings.change_visibility = Change Visibility
2847
- settings.invalid_visibility = The new visibility is not valid.
2848
2847
settings.change_visibility_notices_1 = If the organization is converted to private, the repository stars will be removed and cannot be restored.
2849
2848
settings.change_visibility_notices_2 = Non-members will lose access to the organization’s repositories if visibility is changed to private.
2850
2849
settings.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) {
233
233
234
234
// SettingsChangeVisibilityPost response for change organization visibility
235
235
func 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 {
238
238
ctx .Flash .Error (ctx .Tr ("invalid_data" , visibility ))
239
239
ctx .JSONRedirect (setting .AppSubURL + "/org/" + url .PathEscape (ctx .Org .Organization .Name ) + "/settings" )
240
240
return
You can’t perform that action at this time.
0 commit comments