witten
/
luminotes
Archived
1
0
Fork 0

Fixed a bug that broke that Luminotes Desktop product download page if PayPal took too long to notify Luminotes of the purchase.

This commit is contained in:
Dan Helfman 2008-10-07 13:59:34 -07:00
parent abd5a2a189
commit 815b05e574
4 changed files with 22 additions and 5 deletions

2
NEWS
View File

@ -3,6 +3,8 @@
* You can now create and end links.
* Underline and strikethrough now work.
* Pulldowns for search suggestions, importing, and exporting show up.
* Fixed a bug that broke that Luminotes Desktop product download page if
PayPal took too long to notify Luminotes of the purchase.
1.5.2: October 1, 2008
* Leading/trailing spaces in note titles are now ignored when making links

View File

@ -1636,7 +1636,7 @@ class Users( object ):
result[ "conversion" ] = "download_%s" % item_number
# otherwise, display an auto-reloading "processing..." page
else:
note = Processing_download_note( download_access_id, retry_count )
note = Processing_download_note( download_access_id, tx, retry_count )
result[ "notebook" ] = main_notebook
result[ "startup_notes" ] = self.__database.select_many( Note, main_notebook.sql_load_startup_notes() )

View File

@ -1750,7 +1750,6 @@ class Test_users( Test_controller ):
invite_button = u"send invites",
), session_id = self.session_id )
print result
invites = result[ u"invites" ]
assert len( invites ) == 2
invite = invites[ 0 ]
@ -4463,6 +4462,8 @@ class Test_users( Test_controller ):
assert result[ u"notes" ][ 0 ].notebook_id == self.anon_notebook.object_id
assert u"being processed" in result[ u"notes" ][ 0 ].contents
assert u"retry_count=1" in result[ u"notes" ][ 0 ].contents
assert u'<meta content="2; URL=/users/thanks_download?access_id=%s&retry_count=1" http-equiv="Refresh"></meta>' % access_id \
in result[ u"notes" ][ 0 ].contents
def test_thanks_download_not_yet_paid_with_retry( self ):
access_id = u"wheeaccessid"
@ -4509,6 +4510,8 @@ class Test_users( Test_controller ):
assert result[ u"notes" ][ 0 ].notebook_id == self.anon_notebook.object_id
assert u"being processed" in result[ u"notes" ][ 0 ].contents
assert u"retry_count=4" in result[ u"notes" ][ 0 ].contents
assert u'<meta content="2; URL=/users/thanks_download?access_id=%s&retry_count=4" http-equiv="Refresh"></meta>' % access_id \
in result[ u"notes" ][ 0 ].contents
def test_thanks_download_not_yet_paid_with_retry_timeout( self ):
access_id = u"wheeaccessid"
@ -4555,6 +4558,7 @@ class Test_users( Test_controller ):
assert result[ u"notes" ][ 0 ].notebook_id == self.anon_notebook.object_id
assert u"Thank you" in result[ u"notes" ][ 0 ].contents
assert u"confirmation" in result[ u"notes" ][ 0 ].contents
assert u"<meta " not in result[ u"notes" ][ 0 ].contents
def test_thanks_download_not_yet_paid_tx( self ):
access_id = u"wheeaccessid"
@ -4600,6 +4604,8 @@ class Test_users( Test_controller ):
assert result[ u"notes" ][ 0 ].notebook_id == self.anon_notebook.object_id
assert u"being processed" in result[ u"notes" ][ 0 ].contents
assert u"retry_count=1" in result[ u"notes" ][ 0 ].contents
assert u'<meta content="2; URL=/users/thanks_download?tx=%s&retry_count=1" http-equiv="Refresh"></meta>' % transaction_id \
in result[ u"notes" ][ 0 ].contents
def test_thanks_download_not_yet_paid_tx_with_retry( self ):
access_id = u"wheeaccessid"
@ -4647,6 +4653,8 @@ class Test_users( Test_controller ):
assert result[ u"notes" ][ 0 ].notebook_id == self.anon_notebook.object_id
assert u"being processed" in result[ u"notes" ][ 0 ].contents
assert u"retry_count=4" in result[ u"notes" ][ 0 ].contents
assert u'<meta content="2; URL=/users/thanks_download?tx=%s&retry_count=4" http-equiv="Refresh"></meta>' % transaction_id \
in result[ u"notes" ][ 0 ].contents
def test_thanks_download_not_yet_paid_tx_with_retry_timeout( self ):
access_id = u"wheeaccessid"
@ -4693,6 +4701,7 @@ class Test_users( Test_controller ):
assert result[ u"notes" ][ 0 ].notebook_id == self.anon_notebook.object_id
assert u"Thank you" in result[ u"notes" ][ 0 ].contents
assert u"confirmation" in result[ u"notes" ][ 0 ].contents
assert u"<meta " not in result[ u"notes" ][ 0 ].contents
def test_thanks_download_missing_tx_missing_access_id( self ):
self.login()

View File

@ -2,19 +2,25 @@ from Tags import Html, Head, Meta, H3, P
class Processing_download_note( Html ):
def __init__( self, download_access_id, retry_count ):
def __init__( self, access_id = None, tx = None, retry_count = None ):
if not retry_count:
retry_count = 0
retry_count += 1
if tx:
meta_content = u"2; URL=/users/thanks_download?tx=%s&retry_count=%s" % ( tx, retry_count )
elif access_id:
meta_content = u"2; URL=/users/thanks_download?access_id=%s&retry_count=%s" % ( access_id, retry_count )
else:
raise Exception( u"either tx or access_id required" )
Html.__init__(
self,
Head(
Meta(
http_equiv = u"Refresh",
content = u"2; URL=/users/thanks_download?access_id=%s&retry_count=%s" %
( download_access_id, retry_count ),
content = meta_content,
),
),
H3( u"processing..." ),