Skip to content

Commit

Permalink
use plugin_pool instead of CMSPlugin.__subclasses__() to discover plu…
Browse files Browse the repository at this point in the history
…gins
  • Loading branch information
beniwohli committed Apr 16, 2013
1 parent 3565e61 commit a1e9ec0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cms/utils/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from contextlib import contextmanager
from cms import constants
from cms.models.pluginmodel import CMSPlugin
from cms.plugin_pool import plugin_pool
from cms.utils import get_cms_setting
from cms.management.commands.subcommands.list import plugin_report
from django.conf import settings
Expand Down Expand Up @@ -225,7 +226,9 @@ def check_plugin_instances(output):
def check_copy_relations(output):
c_to_s = lambda klass: '%s.%s' % (klass.__module__, klass.__name__)
with output.section('Presence of "copy_relations"') as section:
for plugin_class in CMSPlugin.__subclasses__():
plugin_pool.discover_plugins()
for plugin in plugin_pool.plugins.values():
plugin_class = plugin.model
if 'copy_relations' in plugin_class.__dict__:
# this class defines a ``copy_relations`` method, nothing more
# to do
Expand Down

0 comments on commit a1e9ec0

Please sign in to comment.