From 5f82c14f0171ec2586fc813e86cfd686d9338404 Mon Sep 17 00:00:00 2001 From: Fabian Braun Date: Mon, 23 Oct 2023 18:07:10 +0200 Subject: [PATCH] fix: Allow empty icon (None) in icon tags (#159) --- .github/workflows/docs.yml | 4 ++-- .readthedocs.yaml | 11 ++++++++--- .../contrib/icon/templatetags/icon_tags.py | 2 +- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index fca48f98..c0a97ada 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -16,7 +16,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v4 with: - python-version: '3.9' + python-version: '3.11' cache: 'pip' - name: Cache dependencies uses: actions/cache@v3.3.2 @@ -41,7 +41,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v4 with: - python-version: '3.9' + python-version: '3.11' cache: 'pip' - name: Cache dependencies uses: actions/cache@v3.3.2 diff --git a/.readthedocs.yaml b/.readthedocs.yaml index c9cc154c..5df0d445 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -1,5 +1,12 @@ +# Read the Docs configuration file +# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details version: 2 +build: + os: ubuntu-22.04 + tools: + python: "3.11" + sphinx: configuration: docs/source/conf.py fail_on_warning: false @@ -9,7 +16,5 @@ formats: - pdf python: - version: 3.8 - install: - - requirements: docs/requirements.txt + - requirements: docs/requirements.txt diff --git a/djangocms_frontend/contrib/icon/templatetags/icon_tags.py b/djangocms_frontend/contrib/icon/templatetags/icon_tags.py index aefeff4b..5eb1b3e6 100644 --- a/djangocms_frontend/contrib/icon/templatetags/icon_tags.py +++ b/djangocms_frontend/contrib/icon/templatetags/icon_tags.py @@ -8,7 +8,7 @@ @register.inclusion_tag("djangocms_frontend/icon/add_css.html", takes_context=True) def add_css_for_icon(context, icon): - if icon.get("library", "") in ICON_LIBRARIES: + if icon and icon.get("library", "") in ICON_LIBRARIES: css_link = ICON_LIBRARIES[icon.get("library")][1] if css_link: if "/" not in css_link: # static link?