Skip to content

Commit ce02a43

Browse files
author
Marius Schulze
committed
fix: use versioning aware filter
1 parent 9110aae commit ce02a43

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/djangocms_snippet/models.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ def __str__(self):
3535

3636
@property
3737
def name(self):
38-
snippet_qs = Snippet.admin_manager.filter(snippet_grouper=self)
39-
if not snippet_qs.exists():
38+
snippet = Snippet.admin_manager.latest_content(snippet_grouper=self).first()
39+
if not snippet:
4040
empty_grouper = _("Empty Snippet Grouper") # xgettext cannot handle f-strings
4141
return f"{empty_grouper} - {self.pk}"
42-
return snippet_qs.first().name or super().__str__
42+
return snippet.name
4343

4444
def snippet(self, show_editable=False): # NOQA: FBT002
4545
if show_editable:

0 commit comments

Comments
 (0)