Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ref: improve annotations for Outbox Managers #73602

Merged
merged 1 commit into from
Jul 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions src/sentry/models/apitoken.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,7 @@ class ApiToken(ReplicatedControlModel, HasApiScopes):
expires_at = models.DateTimeField(null=True, default=default_expiration)
date_added = models.DateTimeField(default=timezone.now)

objects: ClassVar[ControlOutboxProducingManager[ApiToken]] = ApiTokenManager(
cache_fields=("token",)
)
objects: ClassVar[ApiTokenManager] = ApiTokenManager(cache_fields=("token",))

class Meta:
app_label = "sentry"
Expand Down
6 changes: 2 additions & 4 deletions src/sentry/models/integrations/organization_integration.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from __future__ import annotations

from collections.abc import Mapping
from typing import Any, ClassVar
from typing import Any, ClassVar, Self

from django.db import models
from django.utils import timezone
Expand Down Expand Up @@ -37,9 +37,7 @@ class OrganizationIntegration(ReplicatedControlModel):
# After the grace period, we will mark the status as disabled.
grace_period_end = models.DateTimeField(null=True, blank=True, db_index=True)

objects: ClassVar[
ControlOutboxProducingManager[OrganizationIntegration]
] = ControlOutboxProducingManager()
objects: ClassVar[ControlOutboxProducingManager[Self]] = ControlOutboxProducingManager()

class Meta:
app_label = "sentry"
Expand Down
6 changes: 2 additions & 4 deletions src/sentry/models/organizationmemberteam.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from __future__ import annotations

from collections.abc import Mapping, MutableMapping
from typing import Any, ClassVar
from typing import Any, ClassVar, Self

from django.db import models

Expand All @@ -20,9 +20,7 @@ class OrganizationMemberTeam(ReplicatedRegionModel):
Identifies relationships between organization members and the teams they are on.
"""

objects: ClassVar[
RegionOutboxProducingManager[OrganizationMemberTeam]
] = RegionOutboxProducingManager()
objects: ClassVar[RegionOutboxProducingManager[Self]] = RegionOutboxProducingManager()

__relocation_scope__ = RelocationScope.Organization
category = OutboxCategory.ORGANIZATION_MEMBER_TEAM_UPDATE
Expand Down
Loading