witten
/
luminotes
Archived
1
0
Fork 0

Fixed a bug in which forum post permalinks didn't work on posts after the first ten in a particular thread.

This commit is contained in:
Dan Helfman 2008-12-13 00:19:15 -08:00
parent 070b55848d
commit 799e0c12b0
3 changed files with 56 additions and 2 deletions

4
NEWS
View File

@ -2,9 +2,11 @@
* Added a font selection button to the toolbar.
* Decreased the default note text font size, so now you can see more of your
note text at once.
* Added more rounded corners to several display elements.
* Added rounded corners to several display elements.
* Fixed a Luminotes Desktop bug in which creating and then clicking on a new
note link sometimes caused a red error message.
* Fixed a bug in which forum post permalinks didn't work on posts after the
first ten in a particular thread.
1.5.10: December 4, 2008
* Fixed a bug in which certain new installations of Luminotes Desktop

View File

@ -212,7 +212,11 @@ class Forum( object ):
# if a single note was requested, just return that one note
if note_id:
result[ "notes" ] = [ note for note in result[ "notes" ] if note.object_id == note_id ]
note = self.__database.load( Note, note_id )
if note:
result[ "notes" ] = [ note ]
else:
result[ "notes" ] = []
return result

View File

@ -268,6 +268,54 @@ class Test_forums( Test_controller ):
user = self.database.load( User, self.user.object_id )
assert user.storage_bytes == 0
def test_general_thread_default_with_unknown_note_id( self ):
result = self.http_get( "/forums/general/%s?note_id=unknownid" % self.general_thread.object_id )
assert result.get( u"user" ).object_id == self.anonymous.object_id
assert len( result.get( u"notebooks" ) ) == 4
assert result.get( u"notebooks" )[ 0 ].object_id == self.anon_notebook.object_id
assert result.get( u"login_url" )
assert result.get( u"logout_url" )
assert result.get( u"rate_plan" )
assert result.get( u"notebook" ).object_id == self.general_thread.object_id
assert len( result.get( u"startup_notes" ) ) == 0
assert result.get( u"notes" ) == []
assert result.get( u"parent_id" ) == None
assert result.get( u"note_read_write" ) in ( None, True )
assert result.get( u"total_notes_count" ) == 0
invites = result[ "invites" ]
assert len( invites ) == 0
user = self.database.load( User, self.user.object_id )
assert user.storage_bytes == 0
def test_general_thread_default_with_note_id( self ):
self.__make_notes()
result = self.http_get( "/forums/general/%s?note_id=%s" % ( self.general_thread.object_id, self.note.object_id ) )
assert result.get( u"user" ).object_id == self.anonymous.object_id
assert len( result.get( u"notebooks" ) ) == 4
assert result.get( u"notebooks" )[ 0 ].object_id == self.anon_notebook.object_id
assert result.get( u"login_url" )
assert result.get( u"logout_url" )
assert result.get( u"rate_plan" )
assert result.get( u"notebook" ).object_id == self.general_thread.object_id
assert len( result.get( u"startup_notes" ) ) == 3
assert len( result.get( u"notes" ) ) == 1
assert result.get( u"notes" )[ 0 ].object_id == self.note.object_id
assert result[ u"notes" ][ 0 ].title == u"foo"
assert result.get( u"parent_id" ) == None
assert result.get( u"note_read_write" ) in ( None, True )
assert result.get( u"total_notes_count" ) == 3
invites = result[ "invites" ]
assert len( invites ) == 0
user = self.database.load( User, self.user.object_id )
assert user.storage_bytes == 0
def test_general_thread_default_with_login( self ):
self.login()