From 6547e7ec494d27c3c3d4f5d80b3fde50aa7c9f54 Mon Sep 17 00:00:00 2001
From: Auke Klazema <klazema@astron.nl>
Date: Mon, 1 Apr 2019 14:27:15 +0000
Subject: [PATCH] SW-609: Fix a string join that receives a bytestring

---
 SAS/ResourceAssignment/ResourceAssignmentDatabase/radb.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/SAS/ResourceAssignment/ResourceAssignmentDatabase/radb.py b/SAS/ResourceAssignment/ResourceAssignmentDatabase/radb.py
index 009a985b89a..0319492e10c 100644
--- a/SAS/ResourceAssignment/ResourceAssignmentDatabase/radb.py
+++ b/SAS/ResourceAssignment/ResourceAssignmentDatabase/radb.py
@@ -1335,7 +1335,7 @@ class RADatabase:
             # use psycopg2 mogrify to parse and build the insert values
             # this way we can insert many values in one insert query, returning the id's of each inserted row.
             # this is much faster than psycopg2's executeMany method
-            insert_values = ','.join(self.cursor.mogrify('(%s, %s, %s, %s, %s, %s, %s, %s, %s)', cv) for cv in claim_values)
+            insert_values = ','.join(self.cursor.mogrify("(%s, %s, %s, %s, %s, %s, %s, %s, %s)", cv).decode("UTF-8") for cv in claim_values)
         except Exception as e:
             logger.error("Invalid input, rolling back: %s\n%s" % (claim_values, e))
             self.rollback()
-- 
GitLab