Add support for creating users with a specific ID.

(imported from commit 9a3438924cab8477a9c2494af1b5c2d32783e71c)
This commit is contained in:
Tolga Tezel 2014-05-02 21:04:16 -04:00 committed by Tim Abbott
parent 148959f1b7
commit 8b1199ee35
1 changed files with 4 additions and 1 deletions

View File

@ -44,7 +44,7 @@ def create_user(email, password, realm, full_name, short_name,
avatar_source=UserProfile.AVATAR_FROM_GRAVATAR,
is_mirror_dummy=False, default_sending_stream=None,
default_events_register_stream=None,
default_all_public_streams=None):
default_all_public_streams=None, user_profile_id=None):
user_profile = create_user_profile(realm, email, password, active, bot,
full_name, short_name, bot_owner,
is_mirror_dummy)
@ -56,6 +56,9 @@ def create_user(email, password, realm, full_name, short_name,
if default_all_public_streams is not None:
user_profile.default_all_public_streams = default_all_public_streams
if user_profile_id is not None:
user_profile.id = user_profile_id
user_profile.save()
recipient = Recipient.objects.create(type_id=user_profile.id,
type=Recipient.PERSONAL)