mirror of
https://github.com/GSA/notifications-api.git
synced 2026-01-30 06:21:50 -05:00
Use a unique id
This commit is contained in:
@@ -235,14 +235,14 @@ class PopulateServiceEmailReplyTo(Command):
|
||||
def run(self):
|
||||
services_to_update = """
|
||||
INSERT INTO service_email_reply_to(id, service_id, email_address, is_default, created_at)
|
||||
SELECT '{}', id, reply_to_email_address, true, '{}'
|
||||
SELECT uuid_in(md5(random()::text || now()::text)::cstring), id, reply_to_email_address, true, '{}'
|
||||
FROM services
|
||||
WHERE reply_to_email_address IS NOT NULL
|
||||
AND id NOT IN(
|
||||
SELECT service_id
|
||||
FROM service_email_reply_to
|
||||
)
|
||||
""".format(uuid.uuid4(), datetime.utcnow())
|
||||
""".format(datetime.utcnow())
|
||||
|
||||
result = db.session.execute(services_to_update)
|
||||
db.session.commit()
|
||||
|
||||
Reference in New Issue
Block a user