diff --git a/models/user/user.go b/models/user/user.go index c362cbc6d2b55..9cad1cc7c9d7d 100644 --- a/models/user/user.go +++ b/models/user/user.go @@ -955,6 +955,16 @@ func UpdateUserCols(ctx context.Context, u *User, cols ...string) error { return err } +// UpdateUserColsNoAutoTime update user according special columns +func UpdateUserColsNoAutoTime(ctx context.Context, u *User, cols ...string) error { + if err := ValidateUser(u, cols...); err != nil { + return err + } + + _, err := db.GetEngine(ctx).ID(u.ID).Cols(cols...).NoAutoTime().Update(u) + return err +} + // GetInactiveUsers gets all inactive users func GetInactiveUsers(ctx context.Context, olderThan time.Duration) ([]*User, error) { cond := builder.And( diff --git a/modules/indexer/issues/util.go b/modules/indexer/issues/util.go index 19d835a1d80aa..7647be58e89f2 100644 --- a/modules/indexer/issues/util.go +++ b/modules/indexer/issues/util.go @@ -97,10 +97,14 @@ func getIssueIndexerData(ctx context.Context, issueID int64) (*internal.IndexerD return nil, false, err } + if err := issue.Repo.LoadOwner(ctx); err != nil { + return nil, false, fmt.Errorf("issue.Repo.LoadOwner: %w", err) + } + return &internal.IndexerData{ ID: issue.ID, RepoID: issue.RepoID, - IsPublic: !issue.Repo.IsPrivate, + IsPublic: !issue.Repo.IsPrivate && issue.Repo.Owner.Visibility.IsPublic(), Title: issue.Title, Content: issue.Content, Comments: comments, diff --git a/modules/structs/visible_type.go b/modules/structs/visible_type.go index b5ff353b87630..45af941aa05d9 100644 --- a/modules/structs/visible_type.go +++ b/modules/structs/visible_type.go @@ -39,6 +39,10 @@ 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 { diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index c1a3d37037fe3..fe4b188243f57 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -120,6 +120,7 @@ error404 = The page you are trying to reach either does not exist -
-
- -
-
- - -
-
-
-
- - -
-
-
-
- - -
-
-
-
diff --git a/templates/org/settings/options_dangerzone.tmpl b/templates/org/settings/options_dangerzone.tmpl index 01cf3fd4051dc..d01252e3e1bbc 100644 --- a/templates/org/settings/options_dangerzone.tmpl +++ b/templates/org/settings/options_dangerzone.tmpl @@ -3,6 +3,16 @@
+
+
+
{{ctx.Locale.Tr "org.settings.visibility"}}
+
{{ctx.Locale.Tr "org.settings.visibility_desc"}}
+
+
+ +
+
+
{{ctx.Locale.Tr "org.settings.rename"}}
@@ -25,15 +35,55 @@
+ +