Skip to content

Commit

Permalink
Fix mypy typing
Browse files Browse the repository at this point in the history
  • Loading branch information
mderynck committed Jul 31, 2024
1 parent a2de1ba commit 3e16f5f
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions engine/apps/email/models.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
import typing
import uuid

from django.db import models

if typing.TYPE_CHECKING:
from apps.alerts.models import Alert, AlertGroup
from apps.base.models import UserNotificationPolicy
from apps.user_management.models import User


class EmailMessageQuerySet(models.QuerySet):
def create(self, **kwargs):
Expand All @@ -14,6 +20,11 @@ def create(self, **kwargs):


class EmailMessage(models.Model):
represents_alert: "Alert"
represents_alert_group: "AlertGroup"
notification_policy: typing.Optional["UserNotificationPolicy"]
receiver: typing.Optional["User"]

objects: models.Manager["EmailMessage"] = EmailMessageQuerySet.as_manager()

message_uuid = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
Expand Down

0 comments on commit 3e16f5f

Please sign in to comment.