From 129709379284bcc687375c0f248da3259bba0b56 Mon Sep 17 00:00:00 2001 From: Adam Coldrick Date: Sat, 11 Mar 2017 16:17:22 +0000 Subject: [PATCH] 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 --- storyboard/migrate/launchpad/writer.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/storyboard/migrate/launchpad/writer.py b/storyboard/migrate/launchpad/writer.py index c462b2d3..ee8d6619 100644 --- a/storyboard/migrate/launchpad/writer.py +++ b/storyboard/migrate/launchpad/writer.py @@ -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