Skip to content

Commit

Permalink
add page prefetch for view published button
Browse files Browse the repository at this point in the history
  • Loading branch information
fsbraun committed Jan 27, 2025
1 parent 93a5a24 commit 4246965
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 1 addition & 1 deletion djangocms_versioning/cms_toolbars.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ def _get_published_page_version(self):

return PageContent._original_manager.filter(
page=self.page, language=language, versions__state=PUBLISHED
).first()
).select_related("page").first()

def _add_view_published_button(self):
"""Helper method to add a publish button to the toolbar
Expand Down
1 change: 0 additions & 1 deletion djangocms_versioning/plugin_rendering.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ def render_obj_placeholder(
# the current object and render the placeholder
rescan_placeholders_for_obj(current_obj)
placeholder = Placeholder.objects.get_for_obj(current_obj).get(slot=slot)
placeholder._state.fields_cache["source"] = current_obj # Cache reverse relation
content = self.render_placeholder(
placeholder,
context=context,
Expand Down

0 comments on commit 4246965

Please sign in to comment.