mirror of
https://github.com/GSA/notifications-api.git
synced 2026-05-05 16:48:31 -04:00
The admin app now sends the email from when creating a service and when updating the service name.
This PR removes the need for the email_safe function. The api does not create the email_from field for the service. Tests were updated to reflect this change.
This commit is contained in:
@@ -93,11 +93,5 @@ def init_app(app):
|
||||
return response
|
||||
|
||||
|
||||
def email_safe(string):
|
||||
return "".join([
|
||||
character.lower() if character.isalnum() or character == "." else "" for character in re.sub("\s+", ".", string.strip()) # noqa
|
||||
])
|
||||
|
||||
|
||||
def create_uuid():
|
||||
return str(uuid.uuid4())
|
||||
|
||||
@@ -7,7 +7,6 @@ from flask import (
|
||||
)
|
||||
from sqlalchemy.orm.exc import NoResultFound
|
||||
|
||||
from app import email_safe
|
||||
from app.dao.api_key_dao import (
|
||||
save_model_api_key,
|
||||
get_model_api_keys,
|
||||
@@ -72,8 +71,6 @@ def create_service():
|
||||
user = get_model_users(data['user_id'])
|
||||
|
||||
data.pop('user_id', None)
|
||||
if 'name' in data:
|
||||
data['email_from'] = email_safe(data.get('name', None))
|
||||
|
||||
valid_service, errors = service_schema.load(request.get_json())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user