File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -22,9 +22,17 @@ def update_plugin_pool():
2222 # Loop through the slot plugins associated with the current plugin
2323 for slot_plugin in slot_plugins :
2424 # Add the slot plugin to the global namespace
25- globals ()[slot_plugin .__name__ ] = slot_plugin
26- # Register the slot plugin with the plugin pool
27- plugin_pool .register_plugin (slot_plugin )
25+ # Register slot plugins, checking for name conflicts
26+ for slot_plugin in slot_plugins :
27+ if slot_plugin .__name__ not in plugin_pool .plugins :
28+ globals ()[slot_plugin .__name__ ] = slot_plugin
29+ plugin_pool .register_plugin (slot_plugin )
30+ else :
31+ raise ImproperlyConfigured (
32+ f"Cannot register slot plugin { slot_plugin .__name__ } "
33+ f"since a plugin { slot_plugin .__name__ } is already registered "
34+ f"by { plugin_pool .plugins [slot_plugin .__name__ ].__module__ } ."
35+ )
2836 else :
2937 raise ImproperlyConfigured (
3038 f"Cannot register frontend component { key } since a plugin { plugin .__name__ } "
You can’t perform that action at this time.
0 commit comments