Skip to content

fix(vsts): Guard identity_id is not None before ORM get#107743

Merged
JoshFerge merged 2 commits intomasterfrom
jferg/fix-vsts-none-guard
Feb 6, 2026
Merged

fix(vsts): Guard identity_id is not None before ORM get#107743
JoshFerge merged 2 commits intomasterfrom
jferg/fix-vsts-none-guard

Conversation

@JoshFerge
Copy link
Member

Summary

Found during mypy / django-stubs upgrade in #107710.

Adds a None check on self.identity_id before Identity.objects.get(id=self.identity_id) in VstsApiClient.identity. The field is typed as int | None, so a missing identity_id now raises a clear ValueError instead of a confusing ORM error.

Test plan

  • Pre-commit hooks pass

Found during mypy / django-stubs upgrade in #107710.
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Feb 5, 2026
@JoshFerge JoshFerge marked this pull request as ready for review February 6, 2026 01:17
@JoshFerge JoshFerge requested review from a team as code owners February 6, 2026 01:17
Verifies that accessing the `identity` property raises `ValueError`
when `identity_id` is None.
@JoshFerge JoshFerge merged commit 0c1f328 into master Feb 6, 2026
72 checks passed
@JoshFerge JoshFerge deleted the jferg/fix-vsts-none-guard branch February 6, 2026 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants