Fixed incorrect commit order in import_csv().
This commit is contained in:
parent
32da3d3db2
commit
7a3fe2fc5a
|
@ -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() ) )
|
||||
|
|
|
@ -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 )
|
||||
|
|
Reference in New Issue