mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-20 07:21:13 -05:00
@@ -117,16 +117,16 @@ def purge_functional_test_data(user_email_prefix):
|
||||
current_app.logger.error("Can only be run in development")
|
||||
return
|
||||
|
||||
users = User.query.filter(
|
||||
User.email_address.like(f"{user_email_prefix}%")
|
||||
).all()
|
||||
users = User.query.filter(User.email_address.like(f"{user_email_prefix}%")).all()
|
||||
for usr in users:
|
||||
# Make sure the full email includes a uuid in it
|
||||
# Just in case someone decides to use a similar email address.
|
||||
try:
|
||||
uuid.UUID(usr.email_address.split("@")[0].split("+")[1])
|
||||
except ValueError:
|
||||
print(f"Skipping {usr.email_address} as the user email doesn't contain a UUID.")
|
||||
print(
|
||||
f"Skipping {usr.email_address} as the user email doesn't contain a UUID."
|
||||
)
|
||||
else:
|
||||
services = dao_fetch_all_services_by_user(usr.id)
|
||||
if services:
|
||||
|
||||
@@ -170,7 +170,10 @@ def send_notification_to_queue_detached(
|
||||
|
||||
def send_notification_to_queue(notification, queue=None):
|
||||
send_notification_to_queue_detached(
|
||||
notification.key_type, notification.notification_type, notification.id, queue,
|
||||
notification.key_type,
|
||||
notification.notification_type,
|
||||
notification.id,
|
||||
queue,
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
from datetime import datetime
|
||||
from re import I
|
||||
|
||||
|
||||
from datetime import datetime
|
||||
from flask import Blueprint, current_app, jsonify, request
|
||||
from itsdangerous import BadData, SignatureExpired
|
||||
from notifications_utils.url_safe_token import check_token, generate_token
|
||||
@@ -27,6 +26,7 @@ service_invite = Blueprint("service_invite", __name__)
|
||||
|
||||
register_errors(service_invite)
|
||||
|
||||
|
||||
def _create_service_invite(invited_user, invite_link_host):
|
||||
template_id = current_app.config["INVITATION_EMAIL_TEMPLATE_ID"]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user