Add bot_type field to UserProfile.

This is intended to support creating different types of bots with
potentially limited permissions.
This commit is contained in:
Tomasz Kolek
2016-05-18 20:23:03 +02:00
committed by Tim Abbott
parent 06bc1007fd
commit 8c18b8947f
10 changed files with 54 additions and 26 deletions

View File

@@ -15,7 +15,7 @@ def bulk_create_realms(realm_list):
existing_realms.add(domain)
Realm.objects.bulk_create(realms_to_create)
def bulk_create_users(realms, users_raw, bot=False):
def bulk_create_users(realms, users_raw, bot_type=None):
"""
Creates and saves a UserProfile with the given email.
Has some code based off of UserManage.create_user, but doesn't .save()
@@ -34,7 +34,7 @@ def bulk_create_users(realms, users_raw, bot=False):
for (email, full_name, short_name, active) in users:
domain = resolve_email_to_domain(email)
profile = create_user_profile(realms[domain], email,
initial_password(email), active, bot,
initial_password(email), active, bot_type,
full_name, short_name, None, False)
profiles_to_create.append(profile)
UserProfile.objects.bulk_create(profiles_to_create)