openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #12934
[Merge] lp:~raoul-snyman/openlp/bug-863845 into lp:openlp
Raoul Snyman has proposed merging lp:~raoul-snyman/openlp/bug-863845 into lp:openlp.
Requested reviews:
OpenLP Core (openlp-core)
Related bugs:
Bug #863845 in OpenLP: "Crash upon using the OpenLP 2 importer with newer databases"
https://bugs.launchpad.net/openlp/+bug/863845
For more details, see:
https://code.launchpad.net/~raoul-snyman/openlp/bug-863845/+merge/84162
Fix importing of newer songs databases.
--
https://code.launchpad.net/~raoul-snyman/openlp/bug-863845/+merge/84162
Your team OpenLP Core is requested to review the proposed merge of lp:~raoul-snyman/openlp/bug-863845 into lp:openlp.
=== modified file 'openlp/plugins/songs/lib/olpimport.py'
--- openlp/plugins/songs/lib/olpimport.py 2011-09-05 12:51:16 +0000
+++ openlp/plugins/songs/lib/olpimport.py 2011-12-01 19:24:25 +0000
@@ -124,7 +124,7 @@
if has_media_files:
source_media_files_table = source_meta.tables[u'media_files']
source_media_files_songs_table = \
- source_meta.tables[u'media_files_songs']
+ source_meta.tables.get(u'media_files_songs')
try:
class_mapper(OldMediaFile)
except UnmappedClassError:
@@ -137,8 +137,13 @@
secondary=source_songs_topics_table)
}
if has_media_files:
- song_props['media_files'] = relation(OldMediaFile, backref='songs',
- secondary=source_media_files_songs_table)
+ if source_media_files_songs_table:
+ song_props['media_files'] = relation(OldMediaFile,
+ backref='songs',
+ secondary=source_media_files_songs_table)
+ else:
+ song_props['media_files'] = relation(OldMediaFile,
+ backref='songs')
try:
class_mapper(OldAuthor)
except UnmappedClassError:
Follow ups