From 02532bc0aba9e8abdd2e8ff729ce2e648b5775d6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 May 2026 22:35:18 +0000 Subject: [PATCH 1/2] Chore(deps): bump django-stubs from 6.0.4 to 6.0.5 Bumps [django-stubs](https://github.com/typeddjango/django-stubs) from 6.0.4 to 6.0.5. - [Release notes](https://github.com/typeddjango/django-stubs/releases) - [Commits](https://github.com/typeddjango/django-stubs/compare/6.0.4...6.0.5) --- updated-dependencies: - dependency-name: django-stubs dependency-version: 6.0.5 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements/local.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/local.txt b/requirements/local.txt index d7586b38a..28ff5b17c 100644 --- a/requirements/local.txt +++ b/requirements/local.txt @@ -7,7 +7,7 @@ watchfiles==1.2.0 # https://github.com/samuelcolvin/watchfiles # ------------------------------------------------------------------------------ mypy==2.1.0 # https://github.com/python/mypy -django-stubs==6.0.4 # https://github.com/typeddjango/django-stubs +django-stubs==6.0.5 # https://github.com/typeddjango/django-stubs pytest==9.0.3 # https://github.com/pytest-dev/pytest pytest-cov==7.1.0 # https://github.com/pytest-dev/pytest-cov pytest-xdist==3.8.0 # https://github.com/pytest-dev/pytest-xdist (parallel test execution) From 872f8e7ada5adc4d712eb411b38fa54cccd59f0e Mon Sep 17 00:00:00 2001 From: JSv4 Date: Wed, 27 May 2026 08:57:55 -0500 Subject: [PATCH 2/2] Fix mypy error surfaced by django-stubs 6.0.5 + align pre-commit stubs - doc_tasks.py: annotate corpus_creator_ids as set[int] and use data['corpus__creator_id'] after explicit None-check so mypy no longer infers set[Any | None] (fixes the 'pk__in' Iterable type mismatch that django-stubs 6.0.5 now catches). - .pre-commit-config.yaml: bump django-stubs 6.0.3 -> 6.0.5 and djangorestframework-stubs 3.16.9 -> 3.17.0 so the local hook uses the same stubs as the CI mypy invocation. --- .pre-commit-config.yaml | 4 ++-- opencontractserver/tasks/doc_tasks.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 55f298c33..057f3f063 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -61,8 +61,8 @@ repos: # major breakages (e.g. pypdf 7, openai 3) for the same reason. additional_dependencies: # --- Type stubs ----------------------------------------------- - - django-stubs==6.0.3 - - djangorestframework-stubs==3.16.9 + - django-stubs==6.0.5 + - djangorestframework-stubs==3.17.0 - types-requests==2.33.0.20260408 - types-PyYAML==6.0.12.20260408 # --- Django runtime (must match requirements/base.txt) -------- diff --git a/opencontractserver/tasks/doc_tasks.py b/opencontractserver/tasks/doc_tasks.py index 152141092..2f75c095f 100644 --- a/opencontractserver/tasks/doc_tasks.py +++ b/opencontractserver/tasks/doc_tasks.py @@ -256,10 +256,10 @@ def _create_document_processed_notifications( recipients.add(document.creator) # Add corpus owners from DocumentPath data (bulk fetch to avoid N+1) - corpus_creator_ids = { - data.get("corpus__creator_id") + corpus_creator_ids: set[int] = { + data["corpus__creator_id"] for data in corpus_data - if data.get("corpus__creator_id") + if data.get("corpus__creator_id") is not None } if corpus_creator_ids: corpus_creators = User.objects.filter(pk__in=corpus_creator_ids)