Add timezone argument to do_create_user function.

This commit is contained in:
hackerkid
2017-05-04 18:49:06 +05:30
committed by Tim Abbott
parent e219dda071
commit 34dae708d6
3 changed files with 13 additions and 12 deletions

View File

@@ -6,8 +6,8 @@ from zerver.models import Realm, Stream, UserProfile, Huddle, \
Subscription, Recipient, Client, RealmAuditLog, get_huddle_hash
from zerver.lib.create_user import create_user_profile
def bulk_create_users(realm, users_raw, bot_type=None, tos_version=None):
# type: (Realm, Set[Tuple[Text, Text, Text, bool]], Optional[int], Optional[Text]) -> None
def bulk_create_users(realm, users_raw, bot_type=None, tos_version=None, timezone=u""):
# type: (Realm, Set[Tuple[Text, Text, Text, bool]], Optional[int], Optional[Text], Text) -> None
"""
Creates and saves a UserProfile with the given email.
Has some code based off of UserManage.create_user, but doesn't .save()
@@ -21,7 +21,7 @@ def bulk_create_users(realm, users_raw, bot_type=None, tos_version=None):
profile = create_user_profile(realm, email,
initial_password(email), active, bot_type,
full_name, short_name, None, False, tos_version,
tutorial_status=UserProfile.TUTORIAL_FINISHED,
timezone, tutorial_status=UserProfile.TUTORIAL_FINISHED,
enter_sends=True)
profiles_to_create.append(profile)
UserProfile.objects.bulk_create(profiles_to_create)