Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/pyright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Check types
on: [pull_request]
env:
NODE_VERSION: '18'
PYTHON_VERSION: '3.9'
PYTHON_VERSION: '3.10.4'

permissions:
contents: read
Expand Down
1 change: 1 addition & 0 deletions changes/2.changes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Use the new `get_inline_script_nonce` helper.
5 changes: 3 additions & 2 deletions ckanext/power_bi/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,8 @@ def get_report_config(data_dict: DataDict) -> Dict[str, Any]:
bookmark = resource_view.get('bookmark_%s' % current_lang, None)

locale_format = current_lang if current_lang not in \
POWER_BI_LANG_LOCALES else '%s-%s' % (
current_lang, POWER_BI_LANG_LOCALES[current_lang])
POWER_BI_LANG_LOCALES else '%s-%s' % (
current_lang, POWER_BI_LANG_LOCALES[current_lang])

embed_uri = 'https://app.powerbi.com/reportEmbed?' \
'reportId={report}&groupId={workspace}'.format(
Expand Down Expand Up @@ -263,6 +263,7 @@ def get_report_config(data_dict: DataDict) -> Dict[str, Any]:

return report_config


def get_supported_locales() -> Tuple[List[str], str, List[str]]:
required_locales = config.get(
'ckanext.power_bi.required_locales', '').split()
Expand Down
2 changes: 1 addition & 1 deletion ckanext/power_bi/templates/package/resource_read.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{%- block styles %}
{{ super() }}
{# target body, to override :root #}
<style>
<style nonce="{{- h.get_inline_script_nonce() if 'get_inline_script_nonce' in h else '' -}}">
body{
--power-bi-icon-uri: url("{{ h.power_bi_icon_uri() }}");
}
Expand Down
2 changes: 1 addition & 1 deletion ckanext/power_bi/templates/package/resource_views.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{%- block styles %}
{{ super() }}
{# target body, to override :root #}
<style>
<style nonce="{{- h.get_inline_script_nonce() if 'get_inline_script_nonce' in h else '' -}}">
body{
--power-bi-icon-uri: url("{{ h.power_bi_icon_uri() }}");
}
Expand Down
Loading