@define_check
def check_plugin_instances(output):
    from cms.management.commands.subcommands.list import plugin_report
    with output.section("Plugin instances") as section:
        # get the report
        report = plugin_report()
        section.success("Plugin instances of %s types found in the database" % len(report))
        # loop over plugin types in the report
        for plugin_type in report:
            # warn about those that are not installed
            if not plugin_type["model"]:
                section.error(plugin_type["type"] % "%s has instances but is no longer installed" )
            # warn about those that have unsaved instances
            if plugin_type["unsaved_instances"]:
                section.error("%s has %s unsaved instances" % (plugin_type["type"], len(plugin_type["unsaved_instances"])))

        if section.successful:
            section.finish_success("The plugins in your database are in good order")
        else:
            section.finish_error("There are potentially serious problems with the plugins in your database. \nEven if your site works, you should run the 'manage.py cms list plugins' \ncommand and then the 'manage.py cms delete_orphaned_plugins' command. \nThis will alter your database; read the documentation before using it.")
dataset/ETHPy150Open divio/django-cms/cms/utils/check.py/check_plugin_instances/swapped operands of `%`