Skip to content

Commit

Permalink
fix: Modify language menu for pages only if it is present (#179)
Browse files Browse the repository at this point in the history
* fix:	toolbar fails if language menu is not present

* update test environment

* Add test

* Update compile.py

* Update tests/test_toolbar.py

Co-authored-by: Mark Walker <[email protected]>

---------

Co-authored-by: Mark Walker <[email protected]>
  • Loading branch information
fsbraun and marksweb authored May 26, 2023
1 parent e7f8256 commit 4060eb9
Show file tree
Hide file tree
Showing 31 changed files with 682 additions and 3,728 deletions.
2 changes: 2 additions & 0 deletions djangocms_alias/cms_toolbars.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,8 @@ def enable_create_wizard_button(self):

def override_language_switcher(self):
language_menu = self.toolbar.get_menu(LANGUAGE_MENU_IDENTIFIER, _('Language'))
if not language_menu:
return
# Remove all existing language links
# remove_item uses `items` attribute so we have to copy object
for _item in copy(language_menu.items):
Expand Down
2 changes: 1 addition & 1 deletion tests/requirements/compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def run(*args, **kwargs):
"-m",
"piptools",
"compile",
"--generate-hashes",
# temporarily remove "--generate-hashes", until all dependencies are actual releases
"--allow-unsafe",
] + sys.argv[1:]

Expand Down
167 changes: 0 additions & 167 deletions tests/requirements/djmain-py310-default.txt

This file was deleted.

Loading

0 comments on commit 4060eb9

Please sign in to comment.