Skip to content

Commit d1f1cf8

Browse files
committed
improvements
1 parent 05e5d6c commit d1f1cf8

File tree

3 files changed

+2
-7
lines changed

3 files changed

+2
-7
lines changed

modules/structs/visible_type.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff 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)
4743
func (vt VisibleType) String() string {
4844
for k, v := range VisibilityModes {

options/locale/locale_en-US.ini

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2844,7 +2844,6 @@ settings.permission = Permissions
28442844
settings.repoadminchangeteam = Repository admin can add and remove access for teams
28452845
settings.visibility = Visibility
28462846
settings.change_visibility = Change Visibility
2847-
settings.invalid_visibility = The new visibility is not valid.
28482847
settings.change_visibility_notices_1 = If the organization is converted to private, the repository stars will be removed and cannot be restored.
28492848
settings.change_visibility_notices_2 = Non-members will lose access to the organization’s repositories if visibility is changed to private.
28502849
settings.change_visibility_success = The visibility of organization %s has been successfully changed.

routers/web/org/setting.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,8 +233,8 @@ func SettingsRenamePost(ctx *context.Context) {
233233

234234
// SettingsChangeVisibilityPost response for change organization visibility
235235
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 {
238238
ctx.Flash.Error(ctx.Tr("invalid_data", visibility))
239239
ctx.JSONRedirect(setting.AppSubURL + "/org/" + url.PathEscape(ctx.Org.Organization.Name) + "/settings")
240240
return

0 commit comments

Comments
 (0)