summaryrefslogtreecommitdiffstats
path: root/models/user_mail.go
diff options
context:
space:
mode:
Diffstat (limited to 'models/user_mail.go')
-rw-r--r--models/user_mail.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/models/user_mail.go b/models/user_mail.go
index d929ba5a5d..41f08c9db2 100644
--- a/models/user_mail.go
+++ b/models/user_mail.go
@@ -201,7 +201,7 @@ func MakeEmailPrimary(email *EmailAddress) error {
}
// Make sure the former primary email doesn't disappear.
- formerPrimaryEmail := &EmailAddress{Email: user.Email}
+ formerPrimaryEmail := &EmailAddress{UID: user.ID, Email: user.Email}
has, err = x.Get(formerPrimaryEmail)
if err != nil {
return err