mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2026-05-28 11:14:54 -04:00
fix: enable "Add more..." unit hint for new users (#12565)
For new users, the `EnableRepoUnitHints` is set to false while I think that the original intent of #2221 was to set it to true (the migration set it to true for already existing users in `AddUserRepoUnitHintsSetting`). This PR sets its to true upon user creation.  Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/12565 Reviewed-by: limiting-factor <limiting-factor@noreply.codeberg.org> Reviewed-by: 0ko <0ko@noreply.codeberg.org>
This commit is contained in:
parent
fd283c80b7
commit
68858a9de2
2 changed files with 5 additions and 0 deletions
|
|
@ -761,6 +761,7 @@ func createUser(ctx context.Context, u *User, createdByAdmin bool, overwriteDefa
|
|||
u.Theme = setting.UI.DefaultTheme
|
||||
u.IsRestricted = setting.Service.DefaultUserIsRestricted
|
||||
u.IsActive = !setting.Service.RegisterEmailConfirm && !setting.Service.RegisterManualConfirm
|
||||
u.EnableRepoUnitHints = true
|
||||
|
||||
// Ensure consistency of the dates.
|
||||
if u.UpdatedUnix < u.CreatedUnix {
|
||||
|
|
|
|||
|
|
@ -36,6 +36,10 @@ func TestSignup(t *testing.T) {
|
|||
// should be able to view new user's page
|
||||
req = NewRequest(t, "GET", "/exampleUser")
|
||||
MakeRequest(t, req, http.StatusOK)
|
||||
|
||||
// check default values
|
||||
user := unittest.AssertExistsAndLoadBean(t, &user_model.User{Name: "exampleUser"})
|
||||
assert.True(t, user.EnableRepoUnitHints)
|
||||
}
|
||||
|
||||
func TestSignupAsRestricted(t *testing.T) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue