diff --git a/services/comms/guest-name-job.yaml b/services/comms/guest-name-job.yaml index d1466e5..f31f949 100644 --- a/services/comms/guest-name-job.yaml +++ b/services/comms/guest-name-job.yaml @@ -271,13 +271,13 @@ spec: with conn.cursor() as cur: cur.execute( "SELECT name FROM users WHERE name ~ %s", - (f\"^@\\\\d+:{SERVER_NAME}$\",), + (f"^@\\d+:{SERVER_NAME}$",), ) user_ids = [row[0] for row in cur.fetchall()] if not user_ids: return cur.execute( - \"SELECT user_id, displayname FROM profiles WHERE user_id = ANY(%s)\", + "SELECT user_id, displayname FROM profiles WHERE user_id = ANY(%s)", (user_ids,), ) profiles = {row[0]: row[1] for row in cur.fetchall()} @@ -287,7 +287,7 @@ spec: continue new = None for _ in range(30): - candidate = f\"{random.choice(ADJ)}-{random.choice(NOUN)}\" + candidate = f"{random.choice(ADJ)}-{random.choice(NOUN)}" if candidate not in existing_names: new = candidate existing_names.add(candidate) @@ -295,7 +295,7 @@ spec: if not new: continue cur.execute( - \"INSERT INTO profiles (user_id, displayname) VALUES (%s, %s) ON CONFLICT (user_id) DO UPDATE SET displayname = EXCLUDED.displayname\", + "INSERT INTO profiles (user_id, displayname) VALUES (%s, %s) ON CONFLICT (user_id) DO UPDATE SET displayname = EXCLUDED.displayname", (user_id, new), ) finally: