mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-01 07:35:34 -05:00
Merge branch 'master' into sms_sender_id-for-post-notfications
This commit is contained in:
@@ -73,7 +73,8 @@ from app.errors import (
|
||||
InvalidRequest,
|
||||
register_errors
|
||||
)
|
||||
from app.models import Service, ServiceInboundApi
|
||||
|
||||
from app.models import Service, ServiceInboundApi, AnnualBilling
|
||||
from app.schema_validation import validate
|
||||
from app.service import statistics
|
||||
from app.service.service_inbound_api_schema import (
|
||||
@@ -168,8 +169,6 @@ def create_service():
|
||||
raise InvalidRequest(errors, status_code=400)
|
||||
|
||||
# TODO: to be removed when front-end is updated
|
||||
if 'free_sms_fragment_limit' not in data:
|
||||
data['free_sms_fragment_limit'] = current_app.config['FREE_SMS_TIER_FRAGMENT_COUNT']
|
||||
|
||||
# validate json with marshmallow
|
||||
service_schema.load(request.get_json())
|
||||
|
||||
@@ -6,6 +6,8 @@ from app.models import (
|
||||
KEY_TYPE_TEST, KEY_TYPE_TEAM, KEY_TYPE_NORMAL)
|
||||
|
||||
from notifications_utils.recipients import allowed_to_send_to
|
||||
from app.dao.notifications_dao import get_financial_year
|
||||
from datetime import datetime
|
||||
|
||||
|
||||
def get_recipients_from_request(request_json, key, type):
|
||||
@@ -51,3 +53,12 @@ def service_allowed_to_send_to(recipient, service, key_type):
|
||||
whitelist_members
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
def get_current_financial_year_start_year():
|
||||
now = datetime.now()
|
||||
financial_year_start = now.year
|
||||
start_date, end_date = get_financial_year(now.year)
|
||||
if now < start_date:
|
||||
financial_year_start = financial_year_start - 1
|
||||
return financial_year_start
|
||||
|
||||
Reference in New Issue
Block a user