Skip to content

Commit 48e3293

Browse files
committed
fix tests
1 parent e0886e8 commit 48e3293

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

djangocms_alias/cms_plugins.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ def get_render_template(self, context, instance, placeholder):
4747
def _get_allowed_root_plugins(cls):
4848
if not hasattr(cls, "_cached_allowed_root_plugins"):
4949
cls._cached_allowed_root_plugins = set(plugin_pool.get_all_plugins(root_plugin=True))
50-
print("==>", cls._cached_allowed_root_plugins)
5150
return cls._cached_allowed_root_plugins
5251

5352
@classmethod
@@ -303,12 +302,6 @@ def detach_alias_plugin_view(self, request, plugin_pk):
303302
source_plugin=instance,
304303
)
305304

306-
return self.render_close_frame(
307-
request,
308-
obj=instance,
309-
action="reload",
310-
)
311-
312305
def render_replace_response(self, request, new_plugins, source_placeholder=None, source_plugin=None):
313306
move_plugins, add_plugins = [], []
314307
for plugin in new_plugins:
@@ -331,7 +324,7 @@ def render_replace_response(self, request, new_plugins, source_placeholder=None,
331324
"movedPlugins": move_plugins,
332325
"is_popup": True,
333326
}
334-
if source_plugin is not None:
327+
if source_plugin and source_plugin.pk:
335328
data["replacedPlugin"] = get_plugin_toolbar_info(source_plugin)
336329
if source_placeholder is not None:
337330
data["replacedPlaceholder"] = {

djangocms_alias/forms.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ def __init__(self, *args, initial=None, **kwargs):
114114
self.fields["replace"].widget = forms.HiddenInput()
115115

116116
# Remove the replace option, if "Alias" cannot be a child of parent plugin
117+
initial = initial or {}
117118
plugin = initial.get("plugin")
118119
if plugin and plugin.parent:
119120
plugin_class = plugin.parent.get_plugin_class()

0 commit comments

Comments
 (0)