Commit 9debeb6e authored by Jérome Perrin's avatar Jérome Perrin

deferred_style: save Localizer selected language earlier

Localizer.get_selected_language is only functional in response to user
requests. Saving it in Base_computeReportSection was already too late
because it's already an activity request.
parent 1a7b5349
...@@ -25,6 +25,7 @@ skin_name = request['deferred_portal_skin'] ...@@ -25,6 +25,7 @@ skin_name = request['deferred_portal_skin']
# request). # request).
request_other = portal.ERP5Site_filterRequestForDeferredStyle(request) request_other = portal.ERP5Site_filterRequestForDeferredStyle(request)
localizer_language = portal.Localizer.get_selected_language()
context.activate(activity="SQLQueue", tag=tag, after_tag=after_tag, context.activate(activity="SQLQueue", tag=tag, after_tag=after_tag,
priority=priority).Base_computeReportSection( priority=priority).Base_computeReportSection(
...@@ -35,6 +36,7 @@ context.activate(activity="SQLQueue", tag=tag, after_tag=after_tag, ...@@ -35,6 +36,7 @@ context.activate(activity="SQLQueue", tag=tag, after_tag=after_tag,
skin_name=skin_name, skin_name=skin_name,
format=format, format=format,
priority=priority, priority=priority,
localizer_language=localizer_language,
**kw) **kw)
context.activate(activity='SQLQueue', after_tag=tag).getTitle() context.activate(activity='SQLQueue', after_tag=tag).getTitle()
......
...@@ -18,7 +18,6 @@ else: ...@@ -18,7 +18,6 @@ else:
# Rebuild request_other as report section can have modify request content # Rebuild request_other as report section can have modify request content
request_other = portal.ERP5Site_filterRequestForDeferredStyle(request) request_other = portal.ERP5Site_filterRequestForDeferredStyle(request)
localizer_language = portal.Localizer.get_selected_language()
active_process = portal.portal_activities.newActiveProcess() active_process = portal.portal_activities.newActiveProcess()
for idx, report_section in enumerate(report_section_list): for idx, report_section in enumerate(report_section_list):
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>form, request_other, user_name, tag, skin_name, format, priority, **kw</string> </value> <value> <string>form, request_other, user_name, tag, skin_name, format, priority, localizer_language, **kw</string> </value>
</item> </item>
<item> <item>
<key> <string>_proxy_roles</string> </key> <key> <string>_proxy_roles</string> </key>
......
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