Template
1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo synced 2024-11-26 03:36:10 +01:00

Do requested changes

This commit is contained in:
JakobDev 2024-11-11 16:05:22 +01:00
parent dbb331fde0
commit 87a7b61d7f
No known key found for this signature in database
GPG key ID: 39DEF62C3ED6DC4C
2 changed files with 7 additions and 1 deletions

View file

@ -203,7 +203,7 @@ func GetPrimaryEmailAddressOfUser(ctx context.Context, uid int64) (*EmailAddress
}
// Deletes the primary email address of the user
// This is only alllowed if the user is a organization
// This is only allowed if the user is a organization
func DeletePrimaryEmailAddressOfUser(ctx context.Context, uid int64) error {
user, err := GetUserByID(ctx, uid)
if err != nil {

View file

@ -52,6 +52,8 @@ func TestOrgSettingsChangeEmail(t *testing.T) {
token := getTokenForLoggedInUser(t, session, auth_model.AccessTokenScopeReadOrganization)
t.Run("Invalid", func(t *testing.T) {
defer tests.PrintCurrentTest(t)()
settings := getOrgSettingsFormData(t, session, orgName)
settings["email"] = "invalid"
@ -62,6 +64,8 @@ func TestOrgSettingsChangeEmail(t *testing.T) {
})
t.Run("Valid", func(t *testing.T) {
defer tests.PrintCurrentTest(t)()
settings := getOrgSettingsFormData(t, session, orgName)
settings["email"] = "example@example.com"
@ -72,6 +76,8 @@ func TestOrgSettingsChangeEmail(t *testing.T) {
})
t.Run("Empty", func(t *testing.T) {
defer tests.PrintCurrentTest(t)()
settings := getOrgSettingsFormData(t, session, orgName)
settings["email"] = ""