From b46a74df36297c52c31ad60e49da9496ab85a5df Mon Sep 17 00:00:00 2001 From: Michiel Nauta Date: Mon, 8 Aug 2011 21:04:03 +0000 Subject: [PATCH] 5109: Error when merging duplicate records svn: r18012 --- src/Merge/mergeevent.py | 5 +++-- src/Merge/mergefamily.py | 5 +++-- src/Merge/mergemedia.py | 5 +++-- src/Merge/mergenote.py | 5 +++-- src/Merge/mergeperson.py | 5 +++-- src/Merge/mergeplace.py | 5 +++-- src/Merge/mergerepository.py | 5 +++-- src/Merge/mergesource.py | 5 +++-- 8 files changed, 24 insertions(+), 16 deletions(-) diff --git a/src/Merge/mergeevent.py b/src/Merge/mergeevent.py index 63fa0bdcb..96264e237 100644 --- a/src/Merge/mergeevent.py +++ b/src/Merge/mergeevent.py @@ -185,8 +185,9 @@ class MergeEvents(ManagedWindow.ManagedWindow): query = MergeEventQuery(self.dbstate, phoenix, titanic) query.execute() - self.uistate.viewmanager.active_page.selection.unselect_path( - unselect_path) + if self.uistate.viewmanager.active_page.selection: + self.uistate.viewmanager.active_page.selection.unselect_path( + unselect_path) self.uistate.set_busy_cursor(False) self.close() diff --git a/src/Merge/mergefamily.py b/src/Merge/mergefamily.py index 45fe2aea8..682a371ef 100644 --- a/src/Merge/mergefamily.py +++ b/src/Merge/mergefamily.py @@ -221,8 +221,9 @@ class MergeFamilies(ManagedWindow.ManagedWindow): query.execute() except MergeError, err: ErrorDialog( _("Cannot merge people"), str(err)) - self.uistate.viewmanager.active_page.selection.unselect_path( - unselect_path) + if self.uistate.viewmanager.active_page.selection: + self.uistate.viewmanager.active_page.selection.unselect_path( + unselect_path) self.uistate.set_busy_cursor(False) self.close() diff --git a/src/Merge/mergemedia.py b/src/Merge/mergemedia.py index 56ee6fb94..2801fe73c 100644 --- a/src/Merge/mergemedia.py +++ b/src/Merge/mergemedia.py @@ -165,8 +165,9 @@ class MergeMediaObjects(ManagedWindow.ManagedWindow): query = MergeMediaQuery(self.dbstate, phoenix, titanic) query.execute() - self.uistate.viewmanager.active_page.selection.unselect_path( - unselect_path) + if self.uistate.viewmanager.active_page.selection: + self.uistate.viewmanager.active_page.selection.unselect_path( + unselect_path) self.close() class MergeMediaQuery(object): diff --git a/src/Merge/mergenote.py b/src/Merge/mergenote.py index 4eef7f970..e2e83753a 100644 --- a/src/Merge/mergenote.py +++ b/src/Merge/mergenote.py @@ -175,8 +175,9 @@ class MergeNotes(ManagedWindow.ManagedWindow): query = MergeNoteQuery(self.dbstate, phoenix, titanic) query.execute() - self.uistate.viewmanager.active_page.selection.unselect_path( - unselect_path) + if self.uistate.viewmanager.active_page.selection: + self.uistate.viewmanager.active_page.selection.unselect_path( + unselect_path) self.close() #------------------------------------------------------------------------- diff --git a/src/Merge/mergeperson.py b/src/Merge/mergeperson.py index 8357b045a..10a8ef2d4 100644 --- a/src/Merge/mergeperson.py +++ b/src/Merge/mergeperson.py @@ -325,8 +325,9 @@ class MergePeople(ManagedWindow.ManagedWindow): query.execute() except MergeError, err: ErrorDialog( _("Cannot merge people"), str(err)) - self.uistate.viewmanager.active_page.selection.unselect_path( - unselect_path) + if self.uistate.viewmanager.active_page.selection: + self.uistate.viewmanager.active_page.selection.unselect_path( + unselect_path) self.uistate.set_busy_cursor(False) self.close() if self.update: diff --git a/src/Merge/mergeplace.py b/src/Merge/mergeplace.py index d2b7afb65..1af341462 100644 --- a/src/Merge/mergeplace.py +++ b/src/Merge/mergeplace.py @@ -190,8 +190,9 @@ class MergePlaces(ManagedWindow.ManagedWindow): query = MergePlaceQuery(self.dbstate, phoenix, titanic) query.execute() - self.uistate.viewmanager.active_page.selection.unselect_path( - unselect_path) + if self.uistate.viewmanager.active_page.selection: + self.uistate.viewmanager.active_page.selection.unselect_path( + unselect_path) self.uistate.set_busy_cursor(False) self.close() diff --git a/src/Merge/mergerepository.py b/src/Merge/mergerepository.py index bbde017f8..8bcbff64d 100644 --- a/src/Merge/mergerepository.py +++ b/src/Merge/mergerepository.py @@ -151,8 +151,9 @@ class MergeRepositories(ManagedWindow.ManagedWindow): query = MergeRepoQuery(self.dbstate, phoenix, titanic) query.execute() - self.uistate.viewmanager.active_page.selection.unselect_path( - unselect_path) + if self.uistate.viewmanager.active_page.selection: + self.uistate.viewmanager.active_page.selection.unselect_path( + unselect_path) self.uistate.set_busy_cursor(False) self.close() diff --git a/src/Merge/mergesource.py b/src/Merge/mergesource.py index db387ac20..429a75612 100644 --- a/src/Merge/mergesource.py +++ b/src/Merge/mergesource.py @@ -178,8 +178,9 @@ class MergeSources(ManagedWindow.ManagedWindow): query = MergeSourceQuery(self.dbstate, phoenix, titanic) query.execute() - self.uistate.viewmanager.active_page.selection.unselect_path( - unselect_path) + if self.uistate.viewmanager.active_page.selection: + self.uistate.viewmanager.active_page.selection.unselect_path( + unselect_path) self.uistate.set_busy_cursor(False) self.close()