Skip to content

Commit

Permalink
Fix: Only offer "delete translation" if other translations exist.
Browse files Browse the repository at this point in the history
  • Loading branch information
fsbraun committed Jan 27, 2025
1 parent dcf9cfb commit 392c26c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion djangocms_versioning/cms_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,8 @@ def get_indicator_menu(cls, request, page_content):
versions = page_content._version # Cache from .content_indicator()
back = admin_reverse("cms_pagecontent_changelist") + f"?language={request.GET.get('language')}"
menu = indicators.content_indicator_menu(request, status, versions, back=back)
if ALLOW_DELETING_VERSIONS and (CMS_SUPPORTS_DELETING_TRANSLATIONS or True):
no_translations = len(page_content.page.admin_content_cache.keys())
if ALLOW_DELETING_VERSIONS and (CMS_SUPPORTS_DELETING_TRANSLATIONS or True) and no_translations > 1:
menu.append(
(
_("Delete Translation..."),
Expand Down

0 comments on commit 392c26c

Please sign in to comment.