E.g.
toolbar_pool.toolbars['cms.cms_toolbars.PageToolbar'] = ExtendedPageToolbar you will now have a false mapping which is unexpected by unregister:
def unregister(self, toolbar):
name = '%s.%s' % (toolbar.__module__, toolbar.__name__)
if name not in self.toolbars:
raise ToolbarNotRegistered('The toolbar %s is not registered' % name)
del self.toolbars[name]
... thus it becomes impossible to unregister this toolbar
How I would suggest we do this instead of directly overwriting the PageToolbar key in the toolbar_pool is using the API like so:
I'm not sure whether this will have any undesirable side-effects that someone was trying to avoid but doing it this way doesn't seem to break anything obvious within moderation after some testing.
https://github.com/divio/djangocms-moderation/blob/9dddf2f18b9a9b3ec4dfc4d3b904fb467a1f254d/djangocms_moderation/cms_toolbars.py#L186
E.g.
toolbar_pool.toolbars['cms.cms_toolbars.PageToolbar'] = ExtendedPageToolbar
you will now have a false mapping which is unexpected by unregister:... thus it becomes impossible to unregister this toolbar
How I would suggest we do this instead of directly overwriting the PageToolbar key in the toolbar_pool is using the API like so:
I'm not sure whether this will have any undesirable side-effects that someone was trying to avoid but doing it this way doesn't seem to break anything obvious within moderation after some testing.