diff --git a/src/sentry/models/commitauthor.py b/src/sentry/models/commitauthor.py index 59b56f4f833990..8b7de1c2367018 100644 --- a/src/sentry/models/commitauthor.py +++ b/src/sentry/models/commitauthor.py @@ -1,6 +1,7 @@ from __future__ import annotations -from typing import TYPE_CHECKING, ClassVar +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, ClassVar from django.db import models @@ -13,13 +14,14 @@ class CommitAuthorManager(BaseManager["CommitAuthor"]): - def get_or_create(self, organization_id, email, defaults, **kwargs): + def get_or_create( + self, defaults: Mapping[str, Any] | None = None, **kwargs: Any + ) -> tuple[CommitAuthor, bool]: # Force email address to lowercase because many providers do this. Note though that this isn't technically # to spec; only the domain part of the email address is actually case-insensitive. # See: https://stackoverflow.com/questions/9807909/are-email-addresses-case-sensitive - return super().get_or_create( - organization_id=organization_id, email=email.lower(), defaults=defaults, **kwargs - ) + email = kwargs.pop("email").lower() + return super().get_or_create(defaults=defaults, email=email, **kwargs) @region_silo_model diff --git a/src/sentry/models/release.py b/src/sentry/models/release.py index 53bcfa9646b2c8..f753cd8c17287c 100644 --- a/src/sentry/models/release.py +++ b/src/sentry/models/release.py @@ -885,7 +885,7 @@ def set_commits(self, commit_list): (prr[0], pr_authors_dict.get(prr[1])) for prr in pull_request_resolutions ] - user_by_author: dict[str | None, RpcUser | None] = {None: None} + user_by_author: dict[CommitAuthor | None, RpcUser | None] = {None: None} commits_and_prs = list(itertools.chain(commit_group_authors, pull_request_group_authors))