From 1c48e036f87430d595533c3bb499028427050af1 Mon Sep 17 00:00:00 2001 From: Amogh M Aradhya Date: Wed, 27 Sep 2023 15:26:36 +0530 Subject: [PATCH] Merge branch 'main' into sms-project-starting-notification --- funnel/models/notification_types.py | 2 +- funnel/views/notifications/mixins.py | 2 +- .../views/notifications/project_starting_notification.py | 8 ++------ 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/funnel/models/notification_types.py b/funnel/models/notification_types.py index 00186d7eb..a34c8ee39 100644 --- a/funnel/models/notification_types.py +++ b/funnel/models/notification_types.py @@ -165,7 +165,7 @@ class ProjectStartingNotification( class ProjectTomorrowNotification( - DocumentHasProfile, + DocumentHasAccount, Notification[Project, Optional[Session]], type='project_tomorrow', shadows=ProjectStartingNotification, diff --git a/funnel/views/notifications/mixins.py b/funnel/views/notifications/mixins.py index 99b29f08f..ed8de325a 100644 --- a/funnel/views/notifications/mixins.py +++ b/funnel/views/notifications/mixins.py @@ -6,7 +6,7 @@ import grapheme -from ...models import Account, Project +from ...models import Account, Project, Venue _T = TypeVar('_T') # Host type for SetVar _I = TypeVar('_I') # Input type for SetVar's setter diff --git a/funnel/views/notifications/project_starting_notification.py b/funnel/views/notifications/project_starting_notification.py index 190eac12a..1603b26b8 100644 --- a/funnel/views/notifications/project_starting_notification.py +++ b/funnel/views/notifications/project_starting_notification.py @@ -2,8 +2,6 @@ from __future__ import annotations -from typing import Union - from flask import render_template from baseframe import _, __ @@ -12,8 +10,8 @@ from ...models import ( Project, ProjectStartingNotification, - Session, ProjectTomorrowNotification, + Session, ) from ...transports.sms import SmsPriority, SmsTemplate from ..helpers import shortlink @@ -152,9 +150,7 @@ def email_content(self) -> str: def sms( # type: ignore[override] self, - ) -> Union[ - ProjectStartingTomorrowVenueTemplate, ProjectStartingTomorrowLocationTemplate - ]: + ) -> ProjectStartingTomorrowVenueTemplate | ProjectStartingTomorrowLocationTemplate: venue = self.project.primary_venue if venue is not None: return ProjectStartingTomorrowVenueTemplate(