Browse Source

ref: fix typing for sentry.mail.notifications (#62547)

<!-- Describe your PR here. -->
anthony sottile 1 year ago
parent
commit
4c18a9bd21
2 changed files with 1 additions and 2 deletions
  1. 0 1
      pyproject.toml
  2. 1 1
      src/sentry/mail/notifications.py

+ 0 - 1
pyproject.toml

@@ -390,7 +390,6 @@ module = [
     "sentry.issues.search",
     "sentry.issues.status_change",
     "sentry.mail.adapter",
-    "sentry.mail.notifications",
     "sentry.management.commands.makemigrations",
     "sentry.middleware.access_log",
     "sentry.middleware.auth",

+ 1 - 1
src/sentry/mail/notifications.py

@@ -27,7 +27,7 @@ if TYPE_CHECKING:
 
 def get_headers(notification: BaseNotification) -> Mapping[str, Any]:
     headers = {"X-SMTPAPI": json.dumps({"category": notification.metrics_key})}
-    if isinstance(notification, ProjectNotification):
+    if isinstance(notification, ProjectNotification) and notification.project.slug:
         headers["X-Sentry-Project"] = notification.project.slug
 
     group = getattr(notification, "group", None)