From 9bd3ed2dac57fa5cc84a329d5ebc1146f3054a38 Mon Sep 17 00:00:00 2001 From: Rebecca Law Date: Tue, 12 Sep 2017 09:30:55 +0100 Subject: [PATCH] Use a unique id --- app/commands.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/commands.py b/app/commands.py index dd5167ed6..3dc3a3d37 100644 --- a/app/commands.py +++ b/app/commands.py @@ -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()