forked from go-gitea/gitea
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'giteaofficial/main'
* giteaofficial/main: [skip ci] Updated licenses and gitignores Show whether a PR is WIP inside popups (go-gitea#28975) Unify password changing and invalidate auth tokens (go-gitea#27625) Unify user update methods (go-gitea#28733) Do not render empty comments (go-gitea#29039)
- Loading branch information
Showing
54 changed files
with
1,592 additions
and
1,071 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -285,3 +285,11 @@ | |
lower_email: [email protected] | ||
is_activated: true | ||
is_primary: false | ||
|
||
- | ||
id: 37 | ||
uid: 37 | ||
email: [email protected] | ||
lower_email: [email protected] | ||
is_activated: true | ||
is_primary: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1095,7 +1095,7 @@ | |
allow_git_hook: false | ||
allow_import_local: false | ||
allow_create_organization: true | ||
prohibit_login: true | ||
prohibit_login: false | ||
avatar: avatar29 | ||
avatar_email: [email protected] | ||
use_custom_avatar: false | ||
|
@@ -1332,3 +1332,40 @@ | |
repo_admin_change_team_access: false | ||
theme: "" | ||
keep_activity_private: false | ||
|
||
- | ||
id: 37 | ||
lower_name: user37 | ||
name: user37 | ||
full_name: User 37 | ||
email: [email protected] | ||
keep_email_private: false | ||
email_notifications_preference: enabled | ||
passwd: ZogKvWdyEx:password | ||
passwd_hash_algo: dummy | ||
must_change_password: false | ||
login_source: 0 | ||
login_name: user37 | ||
type: 0 | ||
salt: ZogKvWdyEx | ||
max_repo_creation: -1 | ||
is_active: true | ||
is_admin: false | ||
is_restricted: false | ||
allow_git_hook: false | ||
allow_import_local: false | ||
allow_create_organization: true | ||
prohibit_login: true | ||
avatar: avatar29 | ||
avatar_email: [email protected] | ||
use_custom_avatar: false | ||
num_followers: 0 | ||
num_following: 0 | ||
num_stars: 0 | ||
num_repos: 0 | ||
num_teams: 0 | ||
num_members: 0 | ||
visibility: 0 | ||
repo_admin_change_team_access: false | ||
theme: "" | ||
keep_activity_private: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,96 +42,6 @@ func TestIsEmailUsed(t *testing.T) { | |
assert.False(t, isExist) | ||
} | ||
|
||
func TestAddEmailAddress(t *testing.T) { | ||
assert.NoError(t, unittest.PrepareTestDatabase()) | ||
|
||
assert.NoError(t, user_model.AddEmailAddress(db.DefaultContext, &user_model.EmailAddress{ | ||
Email: "[email protected]", | ||
LowerEmail: "[email protected]", | ||
IsPrimary: true, | ||
IsActivated: true, | ||
})) | ||
|
||
// ErrEmailAlreadyUsed | ||
err := user_model.AddEmailAddress(db.DefaultContext, &user_model.EmailAddress{ | ||
Email: "[email protected]", | ||
LowerEmail: "[email protected]", | ||
}) | ||
assert.Error(t, err) | ||
assert.True(t, user_model.IsErrEmailAlreadyUsed(err)) | ||
} | ||
|
||
func TestAddEmailAddresses(t *testing.T) { | ||
assert.NoError(t, unittest.PrepareTestDatabase()) | ||
|
||
// insert multiple email address | ||
emails := make([]*user_model.EmailAddress, 2) | ||
emails[0] = &user_model.EmailAddress{ | ||
Email: "[email protected]", | ||
LowerEmail: "[email protected]", | ||
IsActivated: true, | ||
} | ||
emails[1] = &user_model.EmailAddress{ | ||
Email: "[email protected]", | ||
LowerEmail: "[email protected]", | ||
IsActivated: true, | ||
} | ||
assert.NoError(t, user_model.AddEmailAddresses(db.DefaultContext, emails)) | ||
|
||
// ErrEmailAlreadyUsed | ||
err := user_model.AddEmailAddresses(db.DefaultContext, emails) | ||
assert.Error(t, err) | ||
assert.True(t, user_model.IsErrEmailAlreadyUsed(err)) | ||
} | ||
|
||
func TestDeleteEmailAddress(t *testing.T) { | ||
assert.NoError(t, unittest.PrepareTestDatabase()) | ||
|
||
assert.NoError(t, user_model.DeleteEmailAddress(db.DefaultContext, &user_model.EmailAddress{ | ||
UID: int64(1), | ||
ID: int64(33), | ||
Email: "[email protected]", | ||
LowerEmail: "[email protected]", | ||
})) | ||
|
||
assert.NoError(t, user_model.DeleteEmailAddress(db.DefaultContext, &user_model.EmailAddress{ | ||
UID: int64(1), | ||
Email: "[email protected]", | ||
LowerEmail: "[email protected]", | ||
})) | ||
|
||
// Email address does not exist | ||
err := user_model.DeleteEmailAddress(db.DefaultContext, &user_model.EmailAddress{ | ||
UID: int64(1), | ||
Email: "[email protected]", | ||
LowerEmail: "[email protected]", | ||
}) | ||
assert.Error(t, err) | ||
} | ||
|
||
func TestDeleteEmailAddresses(t *testing.T) { | ||
assert.NoError(t, unittest.PrepareTestDatabase()) | ||
|
||
// delete multiple email address | ||
emails := make([]*user_model.EmailAddress, 2) | ||
emails[0] = &user_model.EmailAddress{ | ||
UID: int64(2), | ||
ID: int64(3), | ||
Email: "[email protected]", | ||
LowerEmail: "[email protected]", | ||
} | ||
emails[1] = &user_model.EmailAddress{ | ||
UID: int64(2), | ||
Email: "[email protected]", | ||
LowerEmail: "[email protected]", | ||
} | ||
assert.NoError(t, user_model.DeleteEmailAddresses(db.DefaultContext, emails)) | ||
|
||
// ErrEmailAlreadyUsed | ||
err := user_model.DeleteEmailAddresses(db.DefaultContext, emails) | ||
assert.Error(t, err) | ||
} | ||
|
||
func TestMakeEmailPrimary(t *testing.T) { | ||
assert.NoError(t, unittest.PrepareTestDatabase()) | ||
|
||
|
Oops, something went wrong.