Skip to content

Commit

Permalink
Remove remove_published_where
Browse files Browse the repository at this point in the history
  • Loading branch information
fsbraun committed Sep 13, 2023
1 parent 910ce03 commit 024fe3a
Showing 1 changed file with 2 additions and 16 deletions.
18 changes: 2 additions & 16 deletions djangocms_versioning/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,23 +286,9 @@ def remove_published_where(queryset):
"""
By default, the versioned queryset filters out so that only versions
that are published are returned. If you need to return the full queryset
this method can be used.
It will modify the sql to remove `where state = 'published'`
use the "admin_manager" instead of "objects"
"""
where_children = queryset.query.where.children
all_except_published = [
lookup for lookup in where_children
if not (
lookup.lookup_name == "exact" and
lookup.rhs == PUBLISHED and
lookup.lhs.field.name == "state"
)
]

queryset.query.where = WhereNode()
queryset.query.where.children = all_except_published
return queryset
raise NotImplementedError("remove_published_where has beenreplaced by ContentObj.admin_manager")


def get_latest_admin_viewable_content(
Expand Down

0 comments on commit 024fe3a

Please sign in to comment.