|
@@ -1,7 +1,7 @@
|
|
|
from __future__ import annotations
|
|
|
|
|
|
from collections.abc import Mapping, Sequence
|
|
|
-from typing import Any, ClassVar
|
|
|
+from typing import TYPE_CHECKING, Any, ClassVar
|
|
|
|
|
|
from django.contrib.postgres.fields import ArrayField as DjangoArrayField
|
|
|
from django.db import models
|
|
@@ -21,6 +21,9 @@ from sentry.db.models import (
|
|
|
)
|
|
|
from sentry.utils.groupreference import find_referenced_groups
|
|
|
|
|
|
+if TYPE_CHECKING:
|
|
|
+ from sentry.models.group import Group
|
|
|
+
|
|
|
|
|
|
class PullRequestManager(BaseManager["PullRequest"]):
|
|
|
def update_or_create(
|
|
@@ -79,7 +82,7 @@ class PullRequest(Model):
|
|
|
|
|
|
__repr__ = sane_repr("organization_id", "repository_id", "key")
|
|
|
|
|
|
- def find_referenced_groups(self):
|
|
|
+ def find_referenced_groups(self) -> set[Group]:
|
|
|
text = f"{self.message} {self.title}"
|
|
|
return find_referenced_groups(text, self.organization_id)
|
|
|
|