Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e2e78c1

Browse files
committed
fix: Undo thread critical opt.
1 parent 89dd767 commit e2e78c1

File tree

1 file changed

+10
-17
lines changed

1 file changed

+10
-17
lines changed

cms/models/pluginmodel.py

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -449,31 +449,24 @@ def get_action_urls(self, js_compat=True):
449449
This method replaces the set of legacy methods `get_add_url`, ``get_edit_url`, `get_move_url`,
450450
`get_delete_url`, `get_copy_url`.
451451
"""
452-
if not hasattr(CMSPlugin, '_edit_url'):
453-
CMSPlugin._edit_url = admin_reverse('cms_placeholder_edit_plugin', args=(0,))
454-
CMSPlugin._add_url = admin_reverse('cms_placeholder_add_plugin')
455-
CMSPlugin._delete_url = admin_reverse('cms_placeholder_delete_plugin', args=(0,))
456-
CMSPlugin._move_url = admin_reverse('cms_placeholder_move_plugin')
457-
CMSPlugin._copy_url = admin_reverse('cms_placeholder_copy_plugins')
458-
459452
if js_compat:
460453
# TODO: Remove this condition
461454
# once the javascript files have been refactored
462455
# to use the new naming schema (ending in _url).
463456
return {
464-
'edit_plugin': re.sub(r"/0/", f"/{self.pk}/", CMSPlugin._edit_url),
465-
'add_plugin': CMSPlugin._add_url,
466-
'delete_plugin': re.sub(r"/0/", f"/{self.pk}/", CMSPlugin._delete_url),
467-
'move_plugin': CMSPlugin._move_url,
468-
'copy_plugin': CMSPlugin._copy_url,
457+
'edit_plugin': admin_reverse('cms_placeholder_edit_plugin', args=(self.pk,)),
458+
'add_plugin': admin_reverse('cms_placeholder_add_plugin'),
459+
'delete_plugin': admin_reverse('cms_placeholder_delete_plugin', args=(self.pk,)),
460+
'move_plugin': admin_reverse('cms_placeholder_move_plugin'),
461+
'copy_plugin':admin_reverse('cms_placeholder_copy_plugins'),
469462
}
470463
else:
471464
return {
472-
'edit_url': re.sub(r"/0/", f"/{self.pk}/", CMSPlugin._edit_url),
473-
'add_url': CMSPlugin._add_url,
474-
'delete_url': re.sub(r"/0/", f"/{self.pk}/", CMSPlugin._delete_url),
475-
'move_url': CMSPlugin._move_url,
476-
'copy_url': CMSPlugin._copy_url,
465+
'edit_url': admin_reverse('cms_placeholder_edit_plugin', args=(self.pk,)),
466+
'add_url': admin_reverse('cms_placeholder_add_plugin'),
467+
'delete_url': admin_reverse('cms_placeholder_delete_plugin', args=(self.pk,)),
468+
'move_url': admin_reverse('cms_placeholder_move_plugin'),
469+
'copy_url': admin_reverse('cms_placeholder_copy_plugins'),
477470
}
478471

479472

0 commit comments

Comments
 (0)