Browse Source

Free trials don't send any transaction info to /users/thanks, so changed the code not to expect it.

Dan Helfman 9 years ago
parent
commit
bbe9d17940
2 changed files with 10 additions and 7 deletions
  1. 6
    3
      controller/Users.py
  2. 4
    4
      view/Thanks_note.py

+ 6
- 3
controller/Users.py View File

@@ -1598,15 +1598,18 @@ class Users( object ):
1598 1598
 
1599 1599
     # if there's no rate plan or we've retried too many times, give up and display an error
1600 1600
     RETRY_TIMEOUT = 15
1601
-    if rate_plan is None or retry_count > RETRY_TIMEOUT:
1601
+    if retry_count > RETRY_TIMEOUT:
1602 1602
       note = Thanks_error_note()
1603 1603
     # if the rate plan of the subscription matches the user's current rate plan, success
1604 1604
     elif rate_plan == result[ u"user" ].rate_plan:
1605 1605
       note = Thanks_note( self.__rate_plans[ rate_plan ][ u"name" ].capitalize() )
1606 1606
       result[ "conversion" ] = "subscribe_%s" % rate_plan
1607
-    # otherwise, display an auto-reloading "processing..." page
1608
-    else:
1607
+    # if a rate plan is given, display an auto-reloading "processing..." page
1608
+    elif rate_plan is not None:
1609 1609
       note = Processing_note( rate_plan, retry_count )
1610
+    # otherwise, assume that this is a free trial and default to a generic thanks page
1611
+    else:
1612
+      note = Thanks_note()
1610 1613
 
1611 1614
     result[ "notebook" ] = main_notebook
1612 1615
     result[ "startup_notes" ] = self.__database.select_many( Note, main_notebook.sql_load_startup_notes() )

+ 4
- 4
view/Thanks_note.py View File

@@ -2,7 +2,7 @@ from Tags import Span, H3, P, A
2 2
 
3 3
 
4 4
 class Thanks_note( Span ):
5
-  def __init__( self, rate_plan_name ):
5
+  def __init__( self, rate_plan_name = None ):
6 6
     Span.__init__(
7 7
       self,
8 8
       H3( u"thank you" ),
@@ -13,9 +13,9 @@ class Thanks_note( Span ):
13 13
       ),
14 14
       P(
15 15
         u"""
16
-        You are now subscribed to Luminotes %s. Please click on one of your
17
-        notebooks to the right to get started with your newly upgraded wiki.
18
-        """ % rate_plan_name,
16
+        You are now subscribed to Luminotes%s. Please click on one of your
17
+        notebooks to the left to get started with your newly upgraded wiki.
18
+        """ % ( rate_plan_name and u" %s" % rate_plan_name or u"" ),
19 19
       ),
20 20
       P(
21 21
         u"""

Loading…
Cancel
Save