diff --git a/gratipay/models/participant.py b/gratipay/models/participant.py index 4add5b30f5..3ff659367f 100644 --- a/gratipay/models/participant.py +++ b/gratipay/models/participant.py @@ -409,9 +409,9 @@ def add_email(self, email, resend_threshold='3 minutes'): add_event(c, 'participant', dict(id=self.id, action='add', values=dict(email=email))) c.run(""" INSERT INTO emails - (address, nonce, verification_start, participant) - VALUES (%s, %s, %s, %s) - """, (email, nonce, verification_start, self.username)) + (address, nonce, verification_start, participant, participant_id) + VALUES (%s, %s, %s, %s, %s) + """, (email, nonce, verification_start, self.username, self.id)) except IntegrityError: nonce = self.db.one(""" UPDATE emails