Commit 418735d7 authored by Gabriel Monnerat's avatar Gabriel Monnerat

Extend code to remove the language from real context url is exist

parent 6a67e8ae
...@@ -75,6 +75,11 @@ while real_context.isTempObject():\n ...@@ -75,6 +75,11 @@ while real_context.isTempObject():\n
real_context = real_context.getParentValue()\n real_context = real_context.getParentValue()\n
real_context_url = real_context.getRelativeUrl()\n real_context_url = real_context.getRelativeUrl()\n
\n \n
real_context_url_list = real_context_url.split("/")\n
current_language = context.Localizer.get_selected_language()\n
if current_language in real_context_url_list:\n
real_context_url = "/".join(filter(lambda x: x != current_language, real_context_url_list))\n
\n
# first filter if we have a custom Pad for the context\n # first filter if we have a custom Pad for the context\n
for knowledge_pad in knowledge_pads:\n for knowledge_pad in knowledge_pads:\n
pad_state = knowledge_pad.getValidationState()\n pad_state = knowledge_pad.getValidationState()\n
...@@ -88,7 +93,7 @@ for knowledge_pad in knowledge_pads:\n ...@@ -88,7 +93,7 @@ for knowledge_pad in knowledge_pads:\n
return knowledge_pad, knowledge_pads\n return knowledge_pad, knowledge_pads\n
elif len(publication_section_list) == 0 and default_pad_group in MARKER and pad_state in visible_state_list:\n elif len(publication_section_list) == 0 and default_pad_group in MARKER and pad_state in visible_state_list:\n
# ERP5 Site front gadget \n # ERP5 Site front gadget \n
return knowledge_pad, knowledge_pads \n return knowledge_pad, knowledge_pads\n
\n \n
# no customized version found for this context so\n # no customized version found for this context so\n
# try finding pad by group\n # try finding pad by group\n
......
756 757
\ No newline at end of file \ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment