mirror of
https://github.com/zulip/zulip.git
synced 2025-11-06 06:53:25 +00:00
[manual] Add User fields to the UserProfile model.
And keep the fields updated, by copying on UserProfile creation and updating the UserProfile object whenever we're updating the User object, and add management commands to (1) initially ensure that they match and (2) check that they still match (aka that the updating code is working). The copy_user_to_userprofile migration needs to be run after this is deployed to prod. (imported from commit 0a598d2e10b1a7a2f5c67dd5140ea4bb8e1ec0b8)
This commit is contained in:
@@ -42,8 +42,14 @@ def bulk_create_users(realms, users_raw):
|
||||
# Now create user_profiles
|
||||
profiles_to_create = []
|
||||
for (email, full_name, short_name, active) in users:
|
||||
user = users_by_email[email]
|
||||
domain = email.split('@')[1]
|
||||
profile = UserProfile(user=users_by_email[email], pointer=-1,
|
||||
profile = UserProfile(user=user, pointer=-1,
|
||||
is_active=user.is_active,
|
||||
is_staff=user.is_staff,
|
||||
date_joined=user.date_joined,
|
||||
email=user.email,
|
||||
password=user.password,
|
||||
realm=realms[domain],
|
||||
full_name=full_name, short_name=short_name)
|
||||
profile.api_key = initial_api_key(email)
|
||||
|
||||
Reference in New Issue
Block a user