diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0a3c1aa7..af48ff49 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -83,7 +83,7 @@ jobs: - run: python -m pip install Django~="${{ matrix.django-version }}.0" - run: python -m pip install -e .[test] - run: python -m pytest -m "not selenium" - - uses: codecov/codecov-action@v4 + - uses: codecov/codecov-action@v5 Selenium: needs: @@ -109,4 +109,4 @@ jobs: - run: python -m pip install Django - run: python -m pip install -e .[test,selenium] - run: python -m pytest -m selenium - - uses: codecov/codecov-action@v4 + - uses: codecov/codecov-action@v5 diff --git a/django_select2/static/django_select2/django_select2.js b/django_select2/static/django_select2/django_select2.js index 01db20b5..935033d3 100644 --- a/django_select2/static/django_select2/django_select2.js +++ b/django_select2/static/django_select2/django_select2.js @@ -68,7 +68,11 @@ } $(function () { - $('.django-select2').djangoSelect2() + $('.django-select2').not('[name*=__prefix__]').djangoSelect2() + + document.addEventListener('formset:added', (event) => { + $(event.target).find('.django-select2').djangoSelect2() + }) }) return $.fn.djangoSelect2 diff --git a/linter-requirements.txt b/linter-requirements.txt index 459cdbb8..2713c027 100644 --- a/linter-requirements.txt +++ b/linter-requirements.txt @@ -1,5 +1,5 @@ -bandit==1.7.9 -black==24.8.0 +bandit==1.8.0 +black==24.10.0 flake8==7.1.1 isort==5.13.2 pydocstyle[toml]==6.3.0