From bbe9d17940ce2c5ffcfb4f224432e9381990149d Mon Sep 17 00:00:00 2001 From: Dan Helfman Date: Wed, 31 Dec 2008 00:19:27 -0800 Subject: [PATCH] Free trials don't send any transaction info to /users/thanks, so changed the code not to expect it. --- controller/Users.py | 9 ++++++--- view/Thanks_note.py | 8 ++++---- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/controller/Users.py b/controller/Users.py index b33ad41..fa9030f 100644 --- a/controller/Users.py +++ b/controller/Users.py @@ -1598,15 +1598,18 @@ class Users( object ): # if there's no rate plan or we've retried too many times, give up and display an error RETRY_TIMEOUT = 15 - if rate_plan is None or retry_count > RETRY_TIMEOUT: + if retry_count > RETRY_TIMEOUT: note = Thanks_error_note() # if the rate plan of the subscription matches the user's current rate plan, success elif rate_plan == result[ u"user" ].rate_plan: note = Thanks_note( self.__rate_plans[ rate_plan ][ u"name" ].capitalize() ) result[ "conversion" ] = "subscribe_%s" % rate_plan - # otherwise, display an auto-reloading "processing..." page - else: + # if a rate plan is given, display an auto-reloading "processing..." page + elif rate_plan is not None: note = Processing_note( rate_plan, retry_count ) + # otherwise, assume that this is a free trial and default to a generic thanks page + else: + note = Thanks_note() result[ "notebook" ] = main_notebook result[ "startup_notes" ] = self.__database.select_many( Note, main_notebook.sql_load_startup_notes() ) diff --git a/view/Thanks_note.py b/view/Thanks_note.py index 1025f08..ce13ee7 100644 --- a/view/Thanks_note.py +++ b/view/Thanks_note.py @@ -2,7 +2,7 @@ from Tags import Span, H3, P, A class Thanks_note( Span ): - def __init__( self, rate_plan_name ): + def __init__( self, rate_plan_name = None ): Span.__init__( self, H3( u"thank you" ), @@ -13,9 +13,9 @@ class Thanks_note( Span ): ), P( u""" - You are now subscribed to Luminotes %s. Please click on one of your - notebooks to the right to get started with your newly upgraded wiki. - """ % rate_plan_name, + You are now subscribed to Luminotes%s. Please click on one of your + notebooks to the left to get started with your newly upgraded wiki. + """ % ( rate_plan_name and u" %s" % rate_plan_name or u"" ), ), P( u"""