More cleanup.

Signed-off-by: Cliff Hill <Clifford.hill@gsa.gov>
This commit is contained in:
Cliff Hill
2024-01-16 15:47:55 -05:00
parent 26bc6198f8
commit bd705ed188
9 changed files with 38 additions and 46 deletions

View File

@@ -408,7 +408,9 @@ def _query_for_billing_data(notification_type, start_date, end_date, service):
func.count().label("notifications_sent"),
)
.filter(
NotificationAllTimeView.status.in_(NotificationStatus.sent_email_types),
NotificationAllTimeView.status.in_(
NotificationStatus.sent_email_types()
),
NotificationAllTimeView.key_type.in_((KeyType.NORMAL, KeyType.TEAM)),
NotificationAllTimeView.created_at >= start_date,
NotificationAllTimeView.created_at < end_date,
@@ -441,7 +443,7 @@ def _query_for_billing_data(notification_type, start_date, end_date, service):
)
.filter(
NotificationAllTimeView.status.in_(
NotificationStatus.billable_sms_types
NotificationStatus.billable_sms_types()
),
NotificationAllTimeView.key_type.in_((KeyType.NORMAL, KeyType.TEAM)),
NotificationAllTimeView.created_at >= start_date,

View File

@@ -9,7 +9,7 @@ class PermissionDAO(DAOClass):
model = Permission
def add_default_service_permissions_for_user(self, user, service):
for name in PermissionType.defaults:
for name in PermissionType.defaults():
permission = Permission(permission=name, user=user, service=service)
self.create_instance(permission, _commit=False)

View File

@@ -275,7 +275,7 @@ def dao_create_service(
raise ValueError("Can't create a service without a user")
if service_permissions is None:
service_permissions = ServicePermissionType.defaults
service_permissions = ServicePermissionType.defaults()
organization = dao_get_organization_by_email_address(user.email_address)