From 5a3c856e4c3f18c02e1dce670760c9c86d891f60 Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Wed, 29 Mar 2006 05:01:27 +0000 Subject: [PATCH] fix place deletion svn: r6223 --- gramps2/ChangeLog | 1 + gramps2/src/DataViews/_PlaceView.py | 17 ++++++++--------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index 75b972dd0..3e3ac8071 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,4 +1,5 @@ 2006-03-28 Don Allingham + * src/DataViews/_PlaceView.py: delete place properly * src/gramps_main.py: remove 2.0.X message * src/ViewManager.py: remove expanduser * src/Exporter.py: remove expanduser diff --git a/gramps2/src/DataViews/_PlaceView.py b/gramps2/src/DataViews/_PlaceView.py index ff9164d61..3645c91bb 100644 --- a/gramps2/src/DataViews/_PlaceView.py +++ b/gramps2/src/DataViews/_PlaceView.py @@ -147,19 +147,18 @@ class PlaceView(PageView.ListView): pass def remove(self,obj): - for event_handle in self.selected_handles(): + for place_handle in self.selected_handles(): db = self.dbstate.db person_list = [ handle for handle in db.get_person_handles(False) - if db.get_person_from_handle(handle).has_handle_reference('Place',event_handle) ] + if db.get_person_from_handle(handle).has_handle_reference('Place',place_handle) ] family_list = [ handle for handle in db.get_family_handles() - if db.get_family_from_handle(handle).has_handle_reference('Place',event_handle) ] + if db.get_family_from_handle(handle).has_handle_reference('Place',place_handle) ] - event = db.get_event_from_handle(event_handle) - - ans = DeletePlaceQuery(event,db, - person_list,family_list) + place = db.get_place_from_handle(place_handle) + + ans = DeletePlaceQuery(place,db) if len(person_list) + len(family_list) > 0: msg = _('This place is currently being used. Deleting it ' @@ -169,9 +168,9 @@ class PlaceView(PageView.ListView): msg = _('Deleting place will remove it from the database.') msg = "%s %s" % (msg,Utils.data_recover_msg) - descr = event.get_description() + descr = place.get_title() if descr == "": - descr = event.get_gramps_id() + descr = place.get_gramps_id() QuestionDialog(_('Delete %s?') % descr, msg, _('_Delete Place'),ans.query_response)