'Save all new issues.  Delete all fixed issues.'

def save_issues(self):

    app.logger.debug('\n\nSaving    Issues.')
    db.session.rollback()
    for item in self.items:
        changes = False
        loaded = False
        if (not hasattr(item, 'db_item')):
            loaded = True
            item.db_item = self.datastore._get_item(item.index, item.region, item.account, item.name)
        existing_issues = list(item.db_item.issues)
        new_issues = item.audit_issues
        for issue in item.db_item.issues:
            if (not issue.auditor_setting):
                self._set_auditor_setting_for_issue(issue)
        old_scored = ['{}    --    {}    --    {}    --    {}    --    {}'.format(old_issue.auditor_setting.auditor_class, old_issue.issue, old_issue.notes, old_issue.score, self._item_list_string(old_issue)) for old_issue in existing_issues]
        for new_issue in new_issues:
            nk = '{}    --    {}    --    {}    --    {}    --    {}'.format(self.__class__.__name__, new_issue.issue, new_issue.notes, new_issue.score, self._item_list_string(new_issue))
            if (nk not in old_scored):
                changes = True
                app.logger.debug('Saving    NEW    issue    {}'.format(nk))
                item.found_new_issue = True
                item.confirmed_new_issues.append(new_issue)
                item.db_item.issues.append(new_issue)
            else:
                for issue in existing_issues:
                    if ((issue.issue == new_issue.issue) and (issue.notes == new_issue.notes) and (issue.score == new_issue.score)):
                        item.confirmed_existing_issues.append(issue)
                        break
                key = '{}/{}/{}/{}'.format(item.index, item.region, item.account, item.name)
                app.logger.debug('Issue    was    previously    found.    Not    overwriting.\n DCTB {}\n DCTB {}'.format(key, nk))
        new_scored = ['{}    --    {}    --    {}    --    {}'.format(new_issue.issue, new_issue.notes, new_issue.score, self._item_list_string(new_issue)) for new_issue in new_issues]
        for old_issue in existing_issues:
            ok = '{}    --    {}    --    {}    --    {}'.format(old_issue.issue, old_issue.notes, old_issue.score, self._item_list_string(old_issue))
            old_issue_class = old_issue.auditor_setting.auditor_class
            if ((old_issue_class is None) or ((old_issue_class == self.__class__.__name__) and (ok not in new_scored))):
                changes = True
                app.logger.debug('Deleting    FIXED    or    REPLACED    issue    {}'.format(ok))
                item.confirmed_fixed_issues.append(old_issue)
                item.db_item.issues.remove(old_issue)
        if changes:
            db.session.add(item.db_item)
        elif loaded:
            db.session.expunge(item.db_item)
    db.session.commit()
    self._create_auditor_settings()
    report_auditor_changes(self)
