mirror of
https://github.com/zulip/zulip.git
synced 2025-11-05 22:43:42 +00:00
onboarding: give new users a list of uncompleted onboarding steps.
(imported from commit 068a6e2112db98965ec5a1c5fc69a9fe285c0333)
This commit is contained in:
@@ -7,6 +7,12 @@ from zephyr.lib.initial_password import initial_api_key
|
||||
from zephyr.models import UserProfile, Recipient, Subscription
|
||||
import base64
|
||||
import hashlib
|
||||
import simplejson
|
||||
|
||||
onboarding_steps = ["sent_stream_message", "sent_private_message", "made_app_sticky"]
|
||||
|
||||
def create_onboarding_steps_blob():
|
||||
return simplejson.dumps([(step, False) for step in onboarding_steps])
|
||||
|
||||
# create_user_profile is based on Django's User.objects.create_user,
|
||||
# except that we don't save to the database so it can used in
|
||||
@@ -21,7 +27,8 @@ def create_user_profile(realm, email, password, active, bot, full_name, short_na
|
||||
user_profile = UserProfile(email=email, is_staff=False, is_active=active,
|
||||
full_name=full_name, short_name=short_name,
|
||||
last_login=now, date_joined=now, realm=realm,
|
||||
pointer=-1, is_bot=bot, bot_owner=bot_owner)
|
||||
pointer=-1, is_bot=bot, bot_owner=bot_owner,
|
||||
onboarding_steps=create_onboarding_steps_blob())
|
||||
|
||||
if bot or not active:
|
||||
user_profile.set_unusable_password()
|
||||
|
||||
Reference in New Issue
Block a user