← Back to team overview

openlp-core team mailing list archive

[Merge] lp:~samscudder/openlp/bug-797695 into lp:openlp

 

Simon Scudder has proposed merging lp:~samscudder/openlp/bug-797695 into lp:openlp.

Requested reviews:
  OpenLP Core (openlp-core)
Related bugs:
  Bug #797695 in OpenLP: "Export and import song is losing Song Book Number"
  https://bugs.launchpad.net/openlp/+bug/797695

For more details, see:
https://code.launchpad.net/~samscudder/openlp/bug-797695/+merge/64881

The hasattr() line is always failing.

It's just to check if the "entry" attribute exists, and since the _get method checks if the attribute exists, and returns an empty string if it doesn't, I judge it's safe to remove the hasattr() test completely.

Tested with OpenLyrics files generated by OpenLP with and without song book number, and worked alright in my environment.
-- 
https://code.launchpad.net/~samscudder/openlp/bug-797695/+merge/64881
Your team OpenLP Core is requested to review the proposed merge of lp:~samscudder/openlp/bug-797695 into lp:openlp.
=== modified file 'openlp/plugins/songs/lib/xml.py'
--- openlp/plugins/songs/lib/xml.py	2011-06-12 16:02:52 +0000
+++ openlp/plugins/songs/lib/xml.py	2011-06-16 18:21:20 +0000
@@ -527,8 +527,7 @@
                         book = Book.populate(name=bookname, publisher=u'')
                         self.manager.save_object(book)
                     song.song_book_id = book.id
-                    if hasattr(songbook, u'entry'):
-                        song.song_number = self._get(songbook, u'entry')
+                    song.song_number = self._get(songbook, u'entry')
                     # We only support one song book, so take the first one.
                     break
 


Follow ups