mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-20 23:41:17 -05:00
Check if test service exists before it gets created
This commit is contained in:
@@ -76,8 +76,7 @@ def service_factory(notify_db, notify_db_session):
|
|||||||
user = create_user()
|
user = create_user()
|
||||||
if not email_from:
|
if not email_from:
|
||||||
email_from = service_name
|
email_from = service_name
|
||||||
service = Service.query.filter_by(name=service_name).first()
|
|
||||||
if not service:
|
|
||||||
service = create_service(
|
service = create_service(
|
||||||
email_from=email_from,
|
email_from=email_from,
|
||||||
service_name=service_name,
|
service_name=service_name,
|
||||||
|
|||||||
@@ -83,6 +83,8 @@ def create_service(
|
|||||||
organisation_type='central',
|
organisation_type='central',
|
||||||
postage='second'
|
postage='second'
|
||||||
):
|
):
|
||||||
|
service = Service.query.filter_by(name=service_name).first()
|
||||||
|
if not service:
|
||||||
service = Service(
|
service = Service(
|
||||||
name=service_name,
|
name=service_name,
|
||||||
message_limit=message_limit,
|
message_limit=message_limit,
|
||||||
|
|||||||
Reference in New Issue
Block a user