'Settings are stored in two attributes: `opf_file` and `cover_file`.
Both may be None. Also returns a recommendation dictionary.'

def commit(self, save_defaults=False):

    recs = self.commit_options(save_defaults)
    self.user_mi = self.get_metadata()
    self.cover_file = self.opf_file = None
    if (self.db is not None):
        (self.mi, self.opf_file) = create_opf_file(self.db, self.book_id)
        cover = self.db.cover(self.book_id, index_is_id=True)
        if cover:
            cf = PersistentTemporaryFile('.jpeg')
            cf.write(cover)
            cf.close()
            self.cover_file = cf
    return recs
