witten
/
luminotes
Archived
1
0
Fork 0

Fixed incorrect commit order in import_csv().

This commit is contained in:
Dan Helfman 2008-09-26 23:01:01 -07:00
parent 32da3d3db2
commit 7a3fe2fc5a
2 changed files with 2 additions and 2 deletions

View File

@ -18,7 +18,7 @@ class Html_cleaner(HTMLParser):
"""
Cleans HTML of any tags not matching a whitelist.
"""
NOTE_LINK_URL_PATTERN = re.compile( '[^"]*/notebooks/\w+\?note_id=\w+', re.IGNORECASE )
NOTE_LINK_URL_PATTERN = re.compile( '[^"]*/notebooks/\w+\?[^"]*note_id=\w+', re.IGNORECASE )
def __init__( self, require_link_target = False ):
HTMLParser.__init__( self, AbstractFormatter( NullWriter() ) )

View File

@ -1895,7 +1895,7 @@ class Notebooks( object ):
( rewritten_contents, rewritten_count ) = self.NOTE_LINK_PATTERN.subn( rewrite_link, note.contents )
if rewritten_count > 0:
note.contents = rewritten_contents
self.__database.save( note )
self.__database.save( note, commit = False )
# delete the CSV file now that it's been imported
self.__database.execute( db_file.sql_delete(), commit = False )