mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-03 09:51:11 -05:00
create entry when creating a new service
This commit is contained in:
@@ -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