From ea95a8b16700e5cceaebebf80fbed693a0a46128 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Fri, 5 Apr 2013 12:34:10 -0400 Subject: [PATCH] Future-proof adding new users to default streams. The previous code for adding users to default streams wouldn't do so if the user didn't have a PreregistrationUser row. (imported from commit 25f1383f6771319542d07660b29d891368889212) --- zephyr/lib/actions.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/zephyr/lib/actions.py b/zephyr/lib/actions.py index c17161c568..4132add9f2 100644 --- a/zephyr/lib/actions.py +++ b/zephyr/lib/actions.py @@ -705,10 +705,13 @@ def do_finish_tutorial(user_profile): # We want to add the default subs list iff there were no subs try: prereg_user = PreregistrationUser.objects.get(email=user_profile.email) + streams = prereg_user.streams.all() except PreregistrationUser.DoesNotExist: - return + # If the user signed up via a mechanism other than + # PreregistrationUser (e.g. Google Apps connect or MitUser), + # just give them the default streams. + streams = [] - streams = prereg_user.streams.all() if len(streams) == 0: streams = get_default_subs(user_profile) for stream in streams: