Add a UUID to the temporary email address

This fixes a bug where two users from Launchpad could
end up with the same temporary email address in StoryBoard,
if they both have the same name. This would cause the
migration of projects to fail since we require email
addresses to be unique.

Change-Id: I7f8a75b9702d81f336cfcd6881ac2d6614ee992c
This commit is contained in:
Adam Coldrick 2017-03-11 16:17:22 +00:00
parent d2ca0f0395
commit 1297093792
1 changed files with 2 additions and 1 deletions

View File

@ -15,6 +15,7 @@
import json
import re
import sys
import uuid
from openid.consumer import consumer
from openid.consumer.discover import DiscoveryFailure
@ -150,7 +151,7 @@ class LaunchpadWriter(object):
user = db_api.entity_create(User, {
'openid': openid,
'full_name': display_name,
'email': "%s@example.com" % (display_name)
'email': "%s-%s@example.com" % (display_name, uuid.uuid4())
}, session=self.session)
self._user_map[openid] = user