Views are removed from grid even if the view was not deleted

Bug #568575 reported by Rick Spencer
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Slip Cover
New
Undecided
Unassigned

Bug Description

Oops. the code just removes all the rows, even if the user chose not to remove the rows. Note that they aren't actually deleted:

    def delete_views(self, widget, data=None):
        for row in self.views_grid.selected_rows:
            title = _("Delete Views")
            message = _("""Are you sure you want to delete the view %s?
This action cannot be undone.""" % row["View"])
            yes = _("Delete View")
            no = _("Cancel")
            response = prompts.yes_no(title,message, yes, no)
            if response == gtk.RESPONSE_YES:
                print self.database.delete_view(row["View"],row["Design Document"])
         self.views_grid.remove_selected_rows()

Possible solutions:
1. track rows that should be removed, and remove those manually
2. extract the method that populates the treeview, and just refresh it

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.