From 7a3fe2fc5a043a972954dc37c7d534c96af8b2a6 Mon Sep 17 00:00:00 2001 From: Dan Helfman Date: Fri, 26 Sep 2008 23:01:01 -0700 Subject: [PATCH] Fixed incorrect commit order in import_csv(). --- controller/Html_cleaner.py | 2 +- controller/Notebooks.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/controller/Html_cleaner.py b/controller/Html_cleaner.py index 9bbfb3d..5eb7049 100644 --- a/controller/Html_cleaner.py +++ b/controller/Html_cleaner.py @@ -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() ) ) diff --git a/controller/Notebooks.py b/controller/Notebooks.py index 870eb63..53657cd 100644 --- a/controller/Notebooks.py +++ b/controller/Notebooks.py @@ -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 )