mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-04 10:21:14 -05:00
Co-authored-by: Kenneth Kehl <@kkehl@flexion.us>
This commit is contained in:
@@ -357,7 +357,6 @@ def _query_for_billing_data(notification_type, start_date, end_date, service):
|
||||
def _email_query():
|
||||
return db.session.query(
|
||||
NotificationAllTimeView.template_id,
|
||||
literal(service.crown).label('crown'),
|
||||
literal(service.id).label('service_id'),
|
||||
literal(notification_type).label('notification_type'),
|
||||
literal('ses').label('sent_by'),
|
||||
@@ -382,7 +381,6 @@ def _query_for_billing_data(notification_type, start_date, end_date, service):
|
||||
international = func.coalesce(NotificationAllTimeView.international, False)
|
||||
return db.session.query(
|
||||
NotificationAllTimeView.template_id,
|
||||
literal(service.crown).label('crown'),
|
||||
literal(service.id).label('service_id'),
|
||||
literal(notification_type).label('notification_type'),
|
||||
sent_by.label('sent_by'),
|
||||
@@ -430,7 +428,7 @@ def get_service_ids_that_need_billing_populated(start_date, end_date):
|
||||
|
||||
|
||||
def get_rate(
|
||||
rates, notification_type, date, crown=None
|
||||
rates, notification_type, date
|
||||
):
|
||||
start_of_day = get_local_midnight_in_utc(date)
|
||||
|
||||
@@ -450,8 +448,7 @@ def update_fact_billing(data, process_day):
|
||||
rates = get_rates_for_billing()
|
||||
rate = get_rate(rates,
|
||||
data.notification_type,
|
||||
process_day,
|
||||
data.crown)
|
||||
process_day)
|
||||
billing_record = create_billing_record(data, rate, process_day)
|
||||
|
||||
table = FactBilling.__table__
|
||||
|
||||
@@ -83,9 +83,6 @@ def dao_update_organisation(organisation_id, **kwargs):
|
||||
if 'organisation_type' in kwargs:
|
||||
_update_organisation_services(organisation, 'organisation_type', only_where_none=False)
|
||||
|
||||
if 'crown' in kwargs:
|
||||
_update_organisation_services(organisation, 'crown', only_where_none=False)
|
||||
|
||||
if 'email_branding_id' in kwargs:
|
||||
_update_organisation_services(organisation, 'email_branding')
|
||||
|
||||
@@ -111,7 +108,6 @@ def dao_add_service_to_organisation(service, organisation_id):
|
||||
|
||||
service.organisation_id = organisation_id
|
||||
service.organisation_type = organisation.organisation_type
|
||||
service.crown = organisation.crown
|
||||
|
||||
db.session.add(service)
|
||||
|
||||
|
||||
@@ -302,8 +302,6 @@ def dao_create_service(
|
||||
if organisation.email_branding:
|
||||
service.email_branding = organisation.email_branding
|
||||
|
||||
if organisation:
|
||||
service.crown = organisation.crown
|
||||
service.count_as_live = not user.platform_admin
|
||||
|
||||
db.session.add(service)
|
||||
|
||||
Reference in New Issue
Block a user