diff --git a/app/musicmuster.py b/app/musicmuster.py index 950f340..800eb1e 100755 --- a/app/musicmuster.py +++ b/app/musicmuster.py @@ -534,6 +534,7 @@ class Window(QMainWindow, Ui_MainWindow): if playlist: playlist.mark_open() + session.commit() return playlist else: log.error("Failed to create playlist") @@ -1019,11 +1020,11 @@ class Window(QMainWindow, Ui_MainWindow): session, template, playlist_name ) - # Need to ensure that the new playlist is committed to - # the database before it is opened by the model. - session.commit() if playlist: playlist.mark_open() + # Need to ensure that the new playlist is committed to + # the database before it is opened by the model. + session.commit() self.create_playlist_tab(playlist) else: log.error("Playlist failed to create")