diff options
author | Unknwon <u@gogs.io> | 2015-02-21 22:13:47 -0500 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2015-02-21 22:13:47 -0500 |
commit | 1654e9ecab3923b7fe5d528fc86c1a549546bd29 (patch) | |
tree | 181f3b578e7ec2dddd407f5d8cc74b9078d21dd8 /models/user.go | |
parent | 065f8d1f561d0529a9e9d155e1aba1255f3d1168 (diff) | |
download | gitea-1654e9ecab3923b7fe5d528fc86c1a549546bd29.tar.gz gitea-1654e9ecab3923b7fe5d528fc86c1a549546bd29.zip |
templates/user/settings/emial.tmpl: little fix on UI
- routers/user: little code format
- conf/locale: update French locale
Diffstat (limited to 'models/user.go')
-rw-r--r-- | models/user.go | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/models/user.go b/models/user.go index 2da0881c81..9f9b0cd7fc 100644 --- a/models/user.go +++ b/models/user.go @@ -627,7 +627,7 @@ func GetUserIdsByNames(names []string) []int64 { return ids } -// Get all email addresses +// GetEmailAddresses returns all e-mail addresses belongs to given user. func GetEmailAddresses(uid int64) ([]*EmailAddress, error) { emails := make([]*EmailAddress, 0, 5) err := x.Where("uid=?", uid).Find(&emails) @@ -641,7 +641,6 @@ func GetEmailAddresses(uid int64) ([]*EmailAddress, error) { } isPrimaryFound := false - for _, email := range emails { if email.Email == u.Email { isPrimaryFound = true @@ -654,7 +653,11 @@ func GetEmailAddresses(uid int64) ([]*EmailAddress, error) { // We alway want the primary email address displayed, even if it's not in // the emailaddress table (yet) if !isPrimaryFound { - emails = append(emails, &EmailAddress{Email: u.Email, IsActivated: true, IsPrimary: true}) + emails = append(emails, &EmailAddress{ + Email: u.Email, + IsActivated: true, + IsPrimary: true, + }) } return emails, nil } |