From 17bca693c6b3f3af40937ec526aaa4872c0f0da6 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sun, 4 Dec 2011 16:36:18 +0000 Subject: [PATCH] Block song exports --- openlp/core/lib/db.py | 5 ++++- openlp/plugins/songs/forms/songexportform.py | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/openlp/core/lib/db.py b/openlp/core/lib/db.py index 160a404a5..b6f12d180 100644 --- a/openlp/core/lib/db.py +++ b/openlp/core/lib/db.py @@ -358,7 +358,10 @@ class Manager(object): def delete_all_objects(self, object_class, filter_clause=None): """ - Delete all object records + Delete all object records. + This method should only be used for simple tables and not ones with + relationships. The relationships are not deleted from the database and + this will lead to database corruptions. ``object_class`` The type of object to delete diff --git a/openlp/plugins/songs/forms/songexportform.py b/openlp/plugins/songs/forms/songexportform.py index 22020a401..20a52c82d 100644 --- a/openlp/plugins/songs/forms/songexportform.py +++ b/openlp/plugins/songs/forms/songexportform.py @@ -252,6 +252,9 @@ class SongExportForm(OpenLPWizard): songs = self.plugin.manager.get_all_objects(Song) songs.sort(cmp=locale.strcoll, key=lambda song: song.title.lower()) for song in songs: + # No need to export temporary songs. + if song.temporary: + continue authors = u', '.join([author.display_name for author in song.authors]) title = u'%s (%s)' % (unicode(song.title), authors)