@manager.option('-a', '--accounts', dest='accounts', type=unicode, default=u'all')
@manager.option('-m', '--monitors', dest='monitors', type=unicode, default=u'all')
def delete_unjustified_issues(accounts, monitors):
 monitor_names = _parse_tech_names(monitors)
 account_names = _parse_accounts(accounts)
 from security_monkey.datastore import ItemAudit
 issues = ItemAudit.query.filter_by(justified=False).all()
 for issue in issues:
  del issue.sub_items[:]
  db.session.delete(issue)
 db.session.commit()

@ manager . option ( '-a' , '--accounts' , dest = 'accounts' , type = unicode , default = u'all' ) @ manager . option ( '-m' , '--monitors' , dest = 'monitors' , type = unicode , default = u'all' ) def delete_unjustified_issues ( accounts , monitors ) : monitor_names = _parse_tech_names ( monitors ) account_names = _parse_accounts ( accounts ) from security_monkey . datastore import ItemAudit issues = ItemAudit . query . filter_by ( justified = False ) . all ( ) for issue in issues : del issue . sub_items [ : ] db . session . delete ( issue ) db . session . commit ( )
allows us to delete unjustified issues .